collision detection now resolves correctly