Adding dtree and rf codes