started working on a rewrite