fix return_depths & add avg_num_of_leaves