Revert "fixed all the permutation functions"

This reverts commit cde7d7b7eba7eb86aa02980dad6118a119124d6c.