completed read user input and read file into both array and list