added histogram tests, factorized sph