Code Refactored.  Added documentation to DBN portion of code.