Adding calculation of permutations.