Coding the detectCollisions method: Part 1