first commit of my partial rewrite