added tests for permutations function