rotation funtion working