finish permutation and combination related templates