BROKEN, but luckily works, need to fix variable_replacement/permuter  so
that it maintains correct type order in the method calls.
appears to be working with permutations correctly