Added _get_leaves