Adding permutation calculation.