more work on when and where to update the octree and matrix