added permutation method