Clean code and add number of iterations as new parameter