PM Quadtree implementation in C