public int logOut(String username){
        try {
            String host = "localhost";
            socket = new Socket(host, 2001);
            
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            out = new PrintWriter(socket.getOutputStream(), true);
        } catch (IOException ex) {
            Logger.getLogger(ServerCommunicator.class.getName()).log(Level.SEVERE, null, ex);
        }
        try{
            out.println("LOGOUT");
            if(in.readLine().startsWith("Ok")){
                out.println(username);
                response = Integer.parseInt(in.readLine());
            }
            else{
                System.out.println("Bad response from server.");
            }
        }
        catch(IOException ex){
            Logger.getLogger(ServerCommunicator.class.getName()).log(Level.SEVERE, null, ex);
        }
        return response;
    }