Implemented backwards rewrite system