Some code for rule30_rev_loop