added rotateTowards function