detect collisions and remove nodes