allow general densities, simplify the comparison methods according to ccooke