add optimize permutations