Converted collision code.