Fixed rotation.
Many refactoring!