Refactored the rotation method. Added comments.
Merge branch 'refactoring' into develop