writing a function to build a list of ints from user input