begin rewrite of dbstruct bugrewrite