Adding function: countleaf(t)