Custom Octree implementation