Add final changes, working version incl permutations