Adds max_length to output_file
Adds basic output file generation
Adds docstring