debugging the permutations function...
it returns [f, 2], [f, x, 1] when it should be [f, 2, [f, x, 1]]...