Collision avoidance implemented but needs a lot of refinement.