Bug fixed. Test case for rotation added