Put back in optimization for bounding volume hierarchy when more than 5000 elements.