bug in shuffle when densities are defined