Write the collision functions.