Add collision code.