more accurate collision detection