changed reading of input file