implemented for loops, there is a discrepancy in getdist and getprev