def read_file(filename, mode='rU', stripChar='\n', replaceChar='', lines=False):
    """
    Basic implementation of reading a text file into a list. Default is to read one line at a time. 

    If lines=True, uses read.readlines() and return each line of the file as is (includes all whitespace and newline chars)

    If lines=False will strip will remove all characters specified in stripChar and replace with replaceChar. Defaults of those settings are "\n" and "" respectively.

    @return: contents of the file
    """
    with open(filename, mode) as f:
        if lines:
            file_contents = f.readlines()
        else:
            file_contents = []
            for line in f:
                file_contents.append(line.replace(stripChar,replaceChar).strip()),
    
    return file_contents