fixed implementation of read_input to support reading of argv array