Permutation Algorithm Implemented.