public String processInput(String InputLine) {
	
		if (state == WAITING) {
			tgrep = new TestGrepProtocol("client");
			cmdOut = "test";
			state = SEND_FILE;
			tgrep.processInput(cmdOut);
			return cmdOut;
		} else if (state == SEND_FILE) {
		    try {
				if ((cmdOut = read.readLine()) != null) {
					tgrep.processInput(cmdOut);
					return cmdOut;
				} else {
					state = SEND_GREP;
					tgrep.processInput("DONE_FILE_TRANSFER");
					return "DONE_FILE_TRANSFER";
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else if (state == SEND_GREP) {
			state = WAIT_PROCESS;
			result = tgrep.processInput(grepString).split("\n");
			return grepString;
		} else if (state == WAIT_PROCESS) {
			state = CHECK_RESULT;
			return null;
		} else {
			if (InputLine != null) {
				if (index < result.length) {
					localResult = result[index++];
					diff += InputLine.compareTo(localResult);
				}
				return null;
			} else return null;
		}
		return null;
	}