refactored
added comments to dbox code