implements permutation problem