Implemented the quadtree.