public void telnetNegotiation(Client client) {
		// client.telnet = true; // mark as client as being negotiated with

		int s = 0; // current sub-negotiation? (0=incomplete,1=complete)

		ArrayList<String> options = new ArrayList<String>();

		// options.add("IAC WILL MCCP");
		options.add("IAC IAC DO TERMINAL-TYPE");

		// send some telnet negotiation crap
		// IAC WILL MCCP1
		// 255 251 85
		// -- if --
		// IAC DO MCCP1
		// 255 253 85
		// -- then --
		// IAC SB MCCP1 WILL SE
		// 255 250 85 251 250
		// -- else --
		// IAC DONT MCCP1
		// 255 254 85
		// -- then --
		// IAC SB MCCP1 WONT SE
		// 255 250 85 252 250

		// IAC DO TERMINAL-TYPE
		// 255 253 24
		// -- if --
		// IAC WILL TERMINAL-TYPE
		// 255 251 24
		// -- then --

		for (String optstr : options) { // all the things we wish to check?
			// (i.e. we're going to use these if we
			// can

			// send a message
			Telnet.send(optstr, client);

			// deal with reply
			while (s == 0) {

				// a byte buffer to hold the incoming message (hopefully it's
				// less than 10 bytes)
				byte[] byteBuffer1 = new byte[10];

				// capture the response
				// if (client.available() > 0) {
				// client.readBytes();
				// }

				System.out.println("Response Captured");

				System.out.println("Response:");

				for (byte b : byteBuffer1) {
					System.out.println("Processing...");
					int value = b;
					System.out.println(value);
				}

				// handle the response
				if (byteBuffer[0] == 255) { // if that byte is 255 (IAC - Is A
					// Command)

					for (byte b : byteBuffer1) {
						System.out.println("Processing...");
						int value = b;
						System.out.println(value);
					}

					System.out.println("TELNET NEGOTIATION -- BYTES");

					System.out.println("Response: " + Telnet.translate(byteBuffer1));

					// confirming MCCP1 (if told to do, respond again that I will)
					if (byteBuffer1[0] == (byte) 255 && byteBuffer1[1] == (byte) 253 && byteBuffer1[2] == (byte) 85) {
						client.write(new byte[] { (byte) 255, (byte) 85, (byte) 251, (byte) 250 });
					}
					else if (byteBuffer1[0] == (byte) 255 && byteBuffer1[1] == (byte) 254 && byteBuffer1[2] == (byte) 85) {
						client.write(new byte[] { (byte) 255, (byte) 85, (byte) 252, (byte) 250 });
					}
					else {
					}

					/*
					 * if ( Telnet.translate(byteBuffer1).equals("IAC DO MCCP")
					 * ) { Telnet.send("IAC MCCP WILL SB", client); } else if (
					 * Telnet.translate(byteBuffer1).equals("IAC DONT MCCP") ) {
					 * Telnet.send("IAC MCCP WONT SB", client); }
					 */

					s = 1;
				}
			}
		}
		// client.telnet = true;
	}