public ChatSession(final String name) {
        super(name);
        //assign the global variable
        partner = name;
        //removes this thread when the window is closed
        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) {
                Controller.removeClient(name);
            }
        });

        enterField = new JTextField("Type message here");
        enterField.addActionListener(
                //this action listener does several things
                //1) clears the JTextField after hitting ENTER
                //2) determines size of message
                //  a) if message is <= MAX_MSG_SIZE, nothing special happens, the message is just displayed
                //  b) if it's larger than MAX_MSG_SIZE, it's splitup & has a prefix put in front to show the order
                //3) the global timestamp is updated after the message is sent
                new ActionListener() {
                    
                    public void actionPerformed(ActionEvent event) {
                        try {
                            // get message from textfield 
                            String message = event.getActionCommand();
                            //the message can be sent in 1 time
                            if(message.length() <= MAX_MSG_SIZE){                            
                                displayArea.append("\nMe>>> " + message + "\n");
                                Controller.sendMessage(partner, message);
                                displayArea.setCaretPosition( displayArea.getText().length());
                            }
                            //message needs to be broken into smaller parts
                            else{
                                //determine number of initial "chunks"
                                int tCt = message.length()/MAX_MSG_SIZE;
                                //determine the number of "chunks" with the prefixes added
                                int msgCt = (message.length() + (tCt * 6)) / MAX_MSG_SIZE;
                                //determine if there is any overlap. if there is, increase the # of "chunks"
                                int rest = msgCt % MAX_MSG_SIZE;
                                if(rest != 0) msgCt++;
                                
                                //break up message & send the individual "chunks"
                                for(int i = 0; i < msgCt; i++){
                                    String chunk = "";
                                    //if it's not the last chunk of message
                                    if(i < msgCt - 1)        
                                        chunk = message.substring(i * (MAX_MSG_SIZE - PREFIX_SIZE), (i * (MAX_MSG_SIZE - PREFIX_SIZE)) + (MAX_MSG_SIZE - PREFIX_SIZE));
                                    //it is the last chunk of message
                                    else if(i == msgCt - 1)
                                        chunk = message.substring(i * (MAX_MSG_SIZE - PREFIX_SIZE), message.length());
                                    //create & append the prefix
                                    String pre = "(" + (i + 1) + "/" + msgCt + ") ";
                                    String msgShown = pre + chunk;
                                    //send & display the chunks
                                    displayArea.append("\nMe>>> " + msgShown + "\n");
                                    Controller.sendMessage(partner, msgShown);
                                    displayArea.setCaretPosition( displayArea.getText().length());
                                }
                            }
                            //update the timestamp & reset the textArea
                            startDate = new Date();
                            enterField.setText("");
                        } // end try
                        catch (Exception ioException) {
                            displayMessage(ioException + "\n");
                            ioException.printStackTrace();
                        } // end catch
                    } // end actionPerformed
                } // end inner class
                ); // end call to addActionListener

        add(enterField, BorderLayout.NORTH);

        displayArea = new JTextArea();
        add(new JScrollPane(displayArea), BorderLayout.CENTER);

        setSize(400, 300); // set window size
        setVisible(true); // show window
    } // end Client constructor