Implemented collision detection with a quadtree