C++ quadtree implementation