added fstream to read input file