dbn implementation