First draft of rewrite