update of printing statements and added loop