Changed octree to use a priority queue