Replace collision math with exact arithmetic