Updated rotation logic
Fixed rotation