private static boolean removePlayerFromGame(String gameName, 
                                                String username) {
        boolean isPlayerRemoved = false;
        
        String playerArray[] = lobbyGames.get(gameName);
        
        if (playerArray != null) {
            // Remove username from the player array, shifting
            // everyone in the array down one place
            
            for (int i = 0; i < playerArray.length && 
                                playerArray[i] != null; i++) {
                
                // If this element is not the last element, the next element
                // is at position i + 1. Otherwise, the next element is null
                String nextPlayer = i < playerArray.length - 1 
                              ? playerArray[i + 1] : null;
                              
                if (!isPlayerRemoved) {
                    if (playerArray[i].equals(username)) {
                        
                        playerArray[i] = nextPlayer;
                        isPlayerRemoved = true;
                        
                    }
                } else {
                    // Shift elements to the left now that username
                    // has been deleted
                    playerArray[i] = nextPlayer;
                }
            }
            
            // If the game is empty, delete the game
            if (playerArray[0] == null) {
                lobbyGames.remove(gameName);
            }
        }
        
        if (isPlayerRemoved) {
            notifyLobbyChanged();
        }
        
        return isPlayerRemoved;

    }