public String encrypt (String input) {
	//Below checks whether the string contains any digit characters
	if(input.matches(".*\\d.*")) throw new IllegalArgumentException();
	//Below the replaceAll is used to ignore non-characters until first appearance of a character
	String formatted = input.toUpperCase().replaceAll("[^A-Z]", "");
	if(formatted.length() == 0) throw new IllegalArgumentException();

	char[] characters = formatted.toCharArray();
	//Create a 5x5 table with only capital letters of the cipher
	char[][] Table5x5 = _makeTable5x5(this.cipherKey.replaceAll("[^A-Z]", ""));

	int[] rows = new int[characters.length];
	int[] cols = new int[characters.length];

	for(int i = 0; i < characters.length; i++) {
	    for(int row = 0; row < 5; row++) {
		for(int column = 0; column < 5; column++) {
		    //If the letter in the table is equal to the character in the array,
		    //Then the row and column # of that letter (in table5x5) is stored
		    //in  rows[i] and cols[i]

		    if(Table5x5[row][column] == characters[i]) {
			rows[i] = row;
			cols[i] = column;
		    }
		    if(characters[i] == 'J' || characters[i] == 'I'){
			rows[i] = jirow;
			cols[i] = jicol;
		    }
		}
	    }
	}

	int[] combined = new int[characters.length * 2];
	System.arraycopy(rows, 0, combined, 0, characters.length);
	System.arraycopy(cols, 0, combined, characters.length, characters.length);

	char[] values = new char[characters.length];
	for(int i = 0; i < combined.length; i=i+2) {
	    values[i/2] = Table5x5[combined[i]][combined[i+1]];
	}

	return new String(values);
    }