finished the read_file part of prog6