rewrite perm(), no output