Fixed the rotateTowards function