added code to read the input file