more work on the bvh, implemented a second version for reference