even more flexibility and better finish condition
Merge branch 'master' into moreObstacles: added flexibility and better finish condition to both branches