Method for permutating.