public void run() {
        try (
            // Create objects to handle client input/output 
            BufferedReader clientIn = new BufferedReader(
                new InputStreamReader(socket.getInputStream()));
                
            PrintWriter clientOut = new PrintWriter(
                socket.getOutputStream(), true);    // 'true' is for autoFlush
        ) {
        
        /** *******************************************************************
        /* Main loop
        /* Take query word from System.in and check if it exists in the word
        /* map. If it does, print the translation out to the client. 
        /* Otherwise, print an error message. 
        /*********************************************************************/
            while ( true ) {
                // Grab the word from the user.
                String query = clientIn.readLine();
                
                // Log client's word
                String clientQueryMsg = 
                    new Date() + " Client " + clientID + " query: " + query;
                System.out.println( clientQueryMsg );
                if (LOG) { logOut.println( clientQueryMsg ); }
                
                // Look the word up and return translation to client.
                if (wordMap.containsKey( query )) {
                    
                    String translation =  wordMap.get( query.toString() );
                    clientOut.println( translation ); 
                    
                    // Log the translation
                    String clientTransMsg = 
                        new Date() + " Client " + clientID + " translation: " +
                        translation;
                    System.out.println( clientTransMsg );
                    if (LOG) { logOut.println( clientTransMsg ); }
                }
                // null if client has disconnected. End the loop.
                else if (query == null ) { break; }
                
                // Error message if word not found in collection. 
                else { 
                    clientOut.println("No translation for " + query.toUpperCase());
                    
                    // Log not finding a translation.s
                    String queryFail = new Date() + " Client " + clientID 
                        + ": No translation for " + query.toUpperCase();
                    System.out.println(queryFail);
                    if (LOG) { logOut.println(queryFail); }
                }
            }
            
        } catch (IOException e) { 
            System.out.println(e); 
            if (LOG) { logOut.println(e); }
        }
        
        // Log disconnect message.
        String disconnectMsg = new Date() + " Client " + clientID + " disconnected.";
        System.out.println( disconnectMsg );
        if (LOG) { logOut.println(disconnectMsg); }
    }