-NB: THIS VERSION HAS ERRATIC PERFORMANCE
-merged static and dynamic layers again
-fixed some edge cases of the collision avoidance