Would be nice to see lines 98 and 99 consistent with lines 107 and 111. I'd be inclined to sort the permutations on on the same line as the return statement in both cases, as the list construction is already quite complex.