unify insert_string_io() and insert_string_rlo()
removed useless declaration
added formal description of the algorithm