Complete overhaul of collision detection