refactoring rule30_rev_string; not fiished