Added debug statements to path finder - think there may be some error in here