public void init() throws IOException, InterruptedException {
		for(int i = 0; i < data.length; i++) {
			data[i] = (byte) i;
		}
		
		ServerSocketChannel server = ServerSocketChannel.open();
		server.configureBlocking(false);
		
		System.out.println("Server Launched!");
		
		server.socket().bind(new InetSocketAddress(7625));
		Selector selector = Selector.open();
		
		//Registers the channel with the selector, must be in non-blocking mode(which it is)
		//OP_ACCEPT is an "interest set", meaning what events you are interested in listening for the channel, via the Selector
		//OP_ACCEPT means the event to listen for is to ACCEPT, can also do CONNECT, READ, or WRITE
		server.register(selector, SelectionKey.OP_ACCEPT); 
		
		while(true) {
			System.out.println("Waiting for a connection");
			selector.select(); //performs a blocking search
			
			Set readyKeys = selector.selectedKeys();
			Iterator iterator = readyKeys.iterator();
			
			while(iterator.hasNext()) {
				SelectionKey key = (SelectionKey) iterator.next();
				iterator.remove();
				
				if(key.isAcceptable()) {
					SocketChannel client = server.accept();
					System.out.println("Accepted connection from " + client);
					client.configureBlocking(false);
					ByteBuffer source = ByteBuffer.wrap(data);
					
					//Creates a selection key, which its interest set is to WRITE, previously one was to ACCEPT
					SelectionKey key2 = client.register(selector, SelectionKey.OP_WRITE);
					key2.attach(source); //puts the data array into the SelectionKey
				} else if(key.isWritable()) {
					SocketChannel client = (SocketChannel) key.channel();
					ByteBuffer output = (ByteBuffer) key.attachment(); //if key was key2, would get "source"(from above)
					
					if(!output.hasRemaining()) {
						output.rewind();
					}
					
					client.write(output);
				}
				
				key.channel().close();
			}
		}
	}