rotate functions implemented