added length function to decision tree