Added rotate function