Uploaded the old collision detection logic