Added count_leaves