edited crash prevention functions to favor traffic