added permutation and rn