private void buildGameArrays(){
        byte[] allGames = GameFactory.getAllGameIds();
        byte[] stanGames = GameFactory.getAllBuiltInGameIds();
        
        // Get the active games
        activeGames = GameFactory.getActiveGameIds();
        

        // Build the built in games array
        builtInGames = new byte[stanGames.length];
        
        // Place the built in games into the order of active games.
        int stanGameCount = 0;
        for(int i=0; i<activeGames.length; i++){
            byte next = activeGames[i];
            
            if(Utils.getIndex(stanGames, next) != -1){
                builtInGames[stanGameCount] = next;
                stanGameCount++;
            }
        }
        
        // Add in any built in games that are not active.
        if(stanGameCount < stanGames.length){
            for(int i=0; i<stanGames.length; i++){
                if(Utils.getIndex(builtInGames, stanGames[i]) == -1){
                    builtInGames[stanGameCount] = stanGames[i];
                    stanGameCount++;
                }
            }
        }
        

        // Build the games array
        int activeGameCount = activeGames.length;
        if(activeGameCount == allGames.length){
            games = Arrays.copyOf(activeGames, activeGameCount);
        } else {
            // Add activeGames to all games then add in any games left over.
            games = new byte[allGames.length];
            System.arraycopy(activeGames, 0, games, 0, activeGameCount);
            
            for(int x=0, added = activeGameCount; x<games.length; x++){
                if(Utils.getIndex(games, allGames[x]) == -1){
                    games[added] = allGames[x];
                    added++;
                }
            }
        }
    }