Implemented collision detection tests