finish permutations   fix issue #31