more rewriting,lots of dd