added for loop parameters and printout button