initial commit of substantial rewrite