first iteration at generalizing collision detection