perms sorted