fixed input file parsing