adding in tow for loops to do it for values of k0 and some number of realisations