added collision avoidance, but it doesn't work yet