Finally, i think i have a working and useable Octree class. Need to test it.