Created loops for plots