problem in apply_rotations...