added rotate function