public void permutations(String a, String z, ArrayList<String> perms){
        if (z.length() <= 1){
            if(!inSaved(a+z, perms))
                perms.add(a + z);
        }
        else{
            for (int i = 0; i < z.length(); i++){
                String temp = z.substring(0,i) + z.substring(i+1);
                permutations(a + z.charAt(i), temp, perms);
            }
        }
    }