added some docstrings, refactored gen_file_paths