Implement method for permutation generation