wip - moving globals into *bdat*