public Integer selectNextActivePlayer() {
        int activePlayerIndex = 0;
        
        //find the currently active player and make inactive
        for (int i = 0; i < players.length ; i++) {
            Player p = players[i];
            if (p == null) {
                continue;
            }
            if(p.getStatus().equals(Player.ACTIVE)){
                activePlayerIndex = i;
                p.setStatus(Player.INACTIVE);
                break;
            }
        }
        //System.out.println("1.active player index -> " + activePlayerIndex);
        //find next active player candidate index
        activePlayerIndex = activePlayerIndex == players.length - 1 ? 0 : activePlayerIndex + 1 ;
       // System.out.println("2.active player index -> " + activePlayerIndex);
        // make sure the next active player candidate is 
        //not null
        //is inactive (not folded,not all in)
        while(players[activePlayerIndex] == null || !players[activePlayerIndex].getStatus().equals(Player.INACTIVE) ){
           System.out.println("3.active player index -> " + activePlayerIndex + " " +players[activePlayerIndex] );
           activePlayerIndex = activePlayerIndex == players.length - 1 ? 0 : activePlayerIndex + 1 ;
        }
        players[activePlayerIndex].setStatus(Player.ACTIVE);
        
        for (Player player : players) {
            if (player == null) {
                continue;
            }
            System.out.println("p : " + player.getId() + " " + player.getName() + " " + player.getStatus() + " " + player.getBet() + " " + player.getMoney());
        }
        updateTimeStamp();
        return activePlayerIndex;
    }