Started working on rewrite