Little work on rewrite