adding while loop to print