All of the corners of the bed are now attached together, via a system of pulleys. This ensures that the bed is level. It cannot lower too far, as there are stops both preventing any of the corners from going too far and distributing the load amongst the four pulleys.

To make the bed stay put, a counterweight is placed at the other end of the cable that ties all the corners together. The counterweight weighs approximately as much as the bed and mattress, allowing friction to hold the bed in place at whatever height it is moved to. The counterweight consists of two pyramidial cinderblocks, made of solid concrete. They have a 1" hole down the center, through which I placed a threaded steel rod. Nuts and washers hold the cinderblocks together, while cut up pieces of 2x4 act as spaces between the two cinderblocks, leaving room for a big steel hook. The hook attaches to the steel rod.

To prevent the cinderblocks from scraping up the wall really bad, I attached wheels (the same wheels from the sofa incident) to the conveniently threaded protruding ends of the steel rod. The wheels are not quite large enough around to fully straddle the cinderblocks, so one needs to roll up and down a 2x4 which acts as a track of sorts. To avoid paying my landlord to paint over tire tracks on my walls, I just wedged a spare piece of plywood between one of the cross-beams and the wall.

(UPDATE: The walls needed repainting anyways. Doh!)