public void takeColor()
   {
       Object inputObj = null;
       Integer outputObj = null;
       // repeat until a Color is received and confirmation is sent
       do {
            // read the Color
           try {
                inputObj = in.readObject();
           } catch ( Exception e ) {
                   // add better error detect later
                   System.err.println( "Error reading color from network"
                                       + " stream:\n" + e );
           }
            // make sure it's OK
            if ( inputObj instanceof Color ) {
                // DEBUG
                System.out.println( "Received color: " + inputObj );
                // Set this player's color
                playerColor = ( Color ) inputObj;
                // Set the other player's color
                if ( this.playerNumber == 1 ) {
                    if ( this.playerColor == Color.white ) {                
                        theDriver.setPlayerColor( 2, Color.blue );
                    } else {
                        theDriver.setPlayerColor( 2, Color.white );
                    }
                } else if ( this.playerNumber == 2 ) {
                    if ( this.playerColor == Color.white ) {                
                        theDriver.setPlayerColor( 1, Color.blue );
                    } else {
                        theDriver.setPlayerColor( 1, Color.white );
                    }
                }
                
                outputObj = new Integer( ROGER );
                try {
                    out.writeObject( outputObj );
                    out.flush();
                } catch ( IOException e ) {
                       System.err.println( "IOException while sending confirm"
                                               + " over network stream:\n" + e);
                }
            } else {
                outputObj = new Integer( RESEND );
                try {
                    out.writeObject( outputObj );
                    out.flush();
                } catch ( IOException e ) {
                       System.err.println( "IOException while sending confirm"
                                               + " over network stream:\n" + e);
                }
            }
       } while ( outputObj.intValue() == RESEND );
   }