refine collision algorithm -- mathematical!