Implemented rotation(with some bugs though!)