formatting data for DBN