rewriting searn