Base code for decision tree