creating the turn funtion from move_to_coord example