refactored rule30_rev_string