private void handleString(String x){
            
            //tests to see if the code matches some predefined server commands  
            if (x.substring (0, 5).equals ("serv."))                       
            {                          
                if (x.equalsIgnoreCase ("serv.dc"))                          
                {                
                    reply ("disconecting");                    
                    disconnectClient (ID);                    
                    return;                    
                }                
                else if (x.split (" ") [0].equalsIgnoreCase ("serv.setuser"))                
                {                
                    username = x.split (" ") [1];                    
                }                
                else if (x.equalsIgnoreCase ("serv.whoami"))                
                {                
                    reply ("Username: " + username);
                }                
                else if (x.equalsIgnoreCase ("serv.close"))                
                {                
                    updateChat ("Closing server, disconnecting all clients");                    
                    updateChat ("Please close your client window");                    
                    exitServer ();                    
                }                
                else if (x.equalsIgnoreCase ("serv.numclients"))                
                {                
                    reply ("# of connected clients: " + flexclients.size());                    
                }                
                else                
                {                
                    reply ("malformed server command");                   
                }                
            }            
            else            
            {            
                updateChat (x);                
            }
        }