added input.close to readfile in parser