private void workOutServer() {
        try {
            Set<SelectionKey> keySet = ((Selector) this.serverTable.get(curServer)[1]).selectedKeys();
            for (SelectionKey key : keySet) {
               // System.out.println("new Key!");
                if ((key.readyOps() & SelectionKey.OP_READ) == SelectionKey.OP_READ) {
                    SocketChannel sc = (SocketChannel) key.channel();
                    ByteBuffer mes = ByteBuffer.allocate(512);
                    if (sc.read(mes) == -1) {
                        disconnect(curServer);
                    }
                    if (mes.array()[0] == 2) {
                        ArrayList<String> l = MessageProcessor.parseBytesToMessages(mes.array());
                        StringBuilder builder = new StringBuilder(l.get(0) + ": ");

             //           System.out.println("Got new message from " + l.get(0));
                        for (int i = 1; i < l.size(); ++i) {
                            builder.append(l.get(i));
                        }
                        System.out.println(builder.toString());
                    } else if (mes.array()[0] == 3) {
                        disconnect(curServer);
                    } else if (mes.array()[0] == 127) {
                        ArrayList<String> l = MessageProcessor.parseBytesToMessages(mes.array());
                        StringBuilder builder = new StringBuilder();
                        for (String aL : l) {
                            builder.append(aL).append(" ");
                        }
                        System.out.println("Error: " + builder.toString());
                    }
                }
            }
            keySet.clear();
        } catch (Exception e) {
            System.out.println("Error while working out server! " + e.getMessage());
        }
    }