creating the rotate function.