changed index for beta distribution