add permutation class and tests