optimized perm