Cleaned up revised octree code