public class Translator
{
	private final String ABC = "?abcdefghijklmnopqrstuvwxyz,.<>[]{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ:;()-+=/*%!1234567890 ";
	
	private String sort(String line)
	{
		char[] key = line.toCharArray();
		String temp1 = "";
		String temp2 = "";
		
		for (int i = 0; i < key.length; i++)
		{
			if (i % 2 == 0)
				temp2 += key[i];
			else
				temp1 += key[i];
		}
		
		return temp1 + temp2;
	}
	
	private int charToInt(char c)
	{
		for (int i = 0; i < ABC.length(); i++)
		{
			if (ABC.charAt(i) == c)
				return i;
		}
		
		return -1;
	}
	
	private char intToChar(int a)
	{
		if (a > 0)
			a = a % ABC.length();
		else if (a < 0)
			a = ABC.length() + a;
		
		return ABC.charAt(a);
	}
	
	/**
	 * Transforms two chars into one depending on the operator passed.
	 * @param a - first char
	 * @param b - second char
	 * @param operator - arithmetical operator used in transformation
	 * @return combined char
	 */
	
	public char combine(char a, char b, char operator)
	{
		int char1 = charToInt(a);
		int char2 = charToInt(b);
		int result = 0;
		
		switch (operator)
		{
			case '+':
				result = char1 + char2;
				break;
			case '-':
				result = char1 - char2;
				break;
		}
		
		return intToChar(result);
	}
	
	public String getInnerKey(String text, String key)
	{
		String innerKey = "";
		
		int i = 0;
		int j = 2;
		
		int sum = (int)(charToInt(key.charAt(i)) * Math.PI);
		
		while (innerKey.length() < text.length())
		{
			innerKey += intToChar(charToInt(key.charAt(i)) + sum + charToInt(key.charAt(i+1)) * (int)(j+Math.E+0.5));
			
			i++; j++; sum += charToInt(key.charAt(i)) + (int)(Math.PI * j);
			
			if (i == key.length()-1)
				i = 0;
		}
		
		for (int k = 0; k < 5; k ++)
		{
			innerKey = sort(innerKey);
		}
		
		return innerKey;
	}
}

@@ -178,43 +178,8 @@
 %0A%09%7B%0A
-%09%09char%5B%5D key = line.toCharArray();%0A
 %09%09St
@@ -241,26 +241,29 @@
  0; i %3C 
-key
+line
 .length
+()
 ; i++)%0A%09
@@ -293,30 +293,38 @@
 %09%09%09temp2 += 
-key%5Bi%5D
+line.charAt(i)
 ;%0A%09%09%09else%0A%09%09
@@ -338,14 +338,22 @@
  += 
-key%5Bi%5D
+line.charAt(i)
 ;%0A%09%09

Update Translator.java