public static char[] build_keyed_alphabet(String k)
	{
		char[] result=new char[26];
		String k_u=k.toUpperCase();
		boolean[] filled=new boolean[26];
		int pos=0;
		for(int i=0;i<k_u.length();i++)
		{
			char cur_c=k_u.charAt(i);
			int char_pos=cur_c-'A';
			if(filled[char_pos])
			{
				continue;
			}
			result[pos]=cur_c;
			filled[char_pos]=true;
			pos++;
		}
		for(int i=0;i<26;i++)
		{
			if(!filled[i])
			{
				char cur_c=(char)('A'+i);
				result[pos]=cur_c;
				pos++;
				filled[i]=true;
			}
		}
		return result;
		
	}