add function to read input file