refactoring rule30_rev_string; not finished 2