factored out the file reading into the run file