Implemented octree functions.