finished permutation algorithm