Improved setperm