Implemented Collision Algorithm