nth_perm added