upgrade of function read_inp