I made an array and used an iteration to print the list