Improved rotate() method in sugar module