fixed freezing

the program no longer freezes, but the path still sticks too close to
obstacles