Added rotate functions and necessary variables for those rotate functions