First draft of CollisionCost function.