Collision detection added.