private String cipher_sub(char[][] square1,char[][] square2, HashMap<Character,Pair<Integer>> h1,String p)
	 {
		 String p_u=p.toUpperCase();
		 ArrayList<Integer> row=new ArrayList<Integer>();
		 ArrayList<Integer> col=new ArrayList<Integer>();
		 for(int i=0;i<p_u.length();i++)
		 {
			 char cur_c=p_u.charAt(i);
			 if(cur_c=='J')
			 {
				 cur_c='I';
			 }
			 Character k=Character.valueOf(cur_c);
			 if(!h1.containsKey(k))
			 {
				 System.err.println("Cannot find character in polybius;");
				 return null;
			 }
			 int cur_r=h1.get(k).get_first();
			 int cur_col=h1.get(k).get_second();
			 row.add(cur_r);
			 col.add(cur_col);
		 }
		row.addAll(col);
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<row.size();i+=2)
		{
			sb.append(square2[row.get(i)][row.get(i+1)]);
		}
		return sb.toString();
	 }