finished while loop in pathFind()