    public void run() {
        try {
            while (true) {
                BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());
                String clientMessage = inFromClient.readLine();
                System.out.println("Received: " + clientMessage);
                if (clientMessage.toLowerCase().equals("shutdown")) {
                    outToClient.writeBytes("goodbye");
                    break;
                } else if (clientMessage.toLowerCase().equals("keyval")) {
                    outToClient.writeBytes(Integer.toString(keyVal));
                    break;
                } else if (clientMessage.contains("article")) {
                    String request = clientMessage.substring(8);
                    System.out.println(request);
                    int req = Integer.parseInt(request);
                    System.out.println(req);
                    int key = Integer.parseInt(keylist.getProperty("" + req));
                    System.out.println(key);
                    if (key > keyVal) {
                        outToClient.writeBytes("FAIL: " + nextNode);
                    } else {
                        outToClient.writeBytes("Key Value is: " + key);
                    }
                }
            }
        } catch (IOException ex) {
            System.out.println("Unable to get streams from client");
        } finally {
            try {
                socket.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }

    public void run() {
        try {
            while (true) {
                BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());
                String clientMessage = inFromClient.readLine();
                System.out.println("Received: " + clientMessage);
                if (clientMessage.toLowerCase().equals("shutdown")) {
                    outToClient.writeBytes("goodbye");
                    break;
                } else if (clientMessage.toLowerCase().equals("keyval")) {
                    outToClient.writeBytes(Integer.toString(keyVal));
                    break;
                } else if (clientMessage.contains("article")) {
                    String request = clientMessage.substring(8);
                    int req = Integer.parseInt(request);
                    int key = Integer.parseInt(keylist.getProperty("" + req));
                    System.out.println(key);
                    if (key > keyVal) {
                        System.out.println("Failed.");
                        outToClient.writeBytes("FAIL: " + nextNode);
                    } else {
                        System.out.println("It's ours!");
                        outToClient.writeBytes("Key Value is: " + key);
                    }
                }
            }
        } catch (IOException ex) {
            System.out.println("Unable to get streams from client");
        } finally {
            try {
                socket.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
