modified the reading of input arguments