read_input function implemented (#2)