Implemented rotations. Some refactoring.