Hacked the rotation little bit. Compiles (at least on mac...), but dumps
core if rotated more than twice.