added open file option & function read_file