progress on rewrite