More work on collision detection