fix several small problems/bugs
add DBN implementation