public static boolean SPUpdateState(Firebase fb, Game game, Move move) {

        Map<String, Object> data = new LinkedHashMap<String, Object>();
        String player = SPStringifySide(SPGetOpposingSide(move.getSide()));

        if (player != null) { data.put(kGameStateCurrentPlayer, player); }
        else { return false; }

        Map<String, Object> boards_won = new LinkedHashMap<String, Object>();
        for (int i=0; i<game.boards.size(); ++i) {
            if (game.boards.get(i).isWon()) {
                Side winner = game.boards.get(i).getWinner();
                if (winner != null) {
                    boards_won.put(""+i, SPStringifySide(winner));
                }
            }
        }

        Map<String, Object> boards_avail = new LinkedHashMap<String, Object>();
        int j=0;
        for (Integer i : game.validBoards()) {
            boards_avail.put(""+j++, ""+i);
            System.out.println("AVAIL BOARD: " + i);
        }
        
        String game_winner = SPStringifySide(game.getWinner());
        
        data.put(kGameStateBoardsWon, boards_won);
        data.put(kGameStateBoardsAvail, boards_avail);

        if (game.isWon()) {
            data.put(kGameStateWinner, game_winner);
            data.put(kGameStateWon, "1");
        }

        FirebaseResponse resp = null;
        try {
            resp = fb.put("state", data);
        } catch (JacksonUtilityException e) {
            e.printStackTrace();
        } catch (FirebaseException e) {
            e.printStackTrace();
        }

        return resp==null ? resp.getSuccess() : false;
    }