Adding Collision Detection logic