def lines_to_list(infile):
    """ put all words in a file into a list """
    nested_list = [line.split() for line in infile]
    # nested_list = []
    # for line in infile:
    #     nested_list.append(line.split())
    flat_list = [item for inner_list in nested_list for item in inner_list]
    # flat_list = []
    # for inner_list in nested_list:
    #     for item in inner_list:
    #         flat_list.append(item)

    return flat_list