Small change to the printList() function to have it print all values on the same line