implementing octree