mostly changes to nbar_zrange to include cosmology