little refactor/generalization, add a couple stopping-case conditions to decision_tree