First attempt at collision avoidance, though it is broken.
Fixed collision avoidance.