bug fix for collision detection

use the standard formula, don't re-invent the wheel.