I've looked over this code with a few other people and we weren't able to determine how this actually does a permutation. Could this code be changed so that it's a little bit more clear as to what's going on here?