modifying input file reading method, still working on