removed recursion from pathing