Added Collision detection