function _finishGame(uint game_id, uint[] memory numbers) private {
        require(games[game_id].bet > 0, "Game not found");

        Game storage game = games[game_id];

        require(!game.finish, "Game over");
        require(game.max_players == game.players.length, "The game has free slots");
        require(numbers.length == (game.uniq_numbers.length > 1 ? game.uniq_numbers.length - 1 : 1), "Incorect winning numbers");
        
        uint bank = game.bet * game.max_players;
        uint bank_use = oraclize_getPrice("random");
        uint num_payout = (bank * (100 - commision) / 100) / numbers.length;
        
        for(uint n = 0; n < numbers.length; n++) {
            uint num_w = 0;

            for(uint j = 0; j < game.numbers.length; j++) {
                if(numbers[n] == game.numbers[j]) {
                    num_w++;
                }
            }

            uint payout = num_payout / num_w;

            for(uint p = 0; p < game.players.length; p++) {
                if(numbers[n] == game.numbers[p]) {
                    if(game.players[p].send(payout)) {
                        bank_use += payout;
                    }

                    emit Winner(game_id, game.players[p], p, payout);

                    if(referers[game.players[p]] != address(0) && referer_commision > 0) {
                        uint referer_payout = payout * referer_commision / 100;

                        if(referers[game.players[p]].send(referer_payout)) {
                            bank_use += referer_payout;
                        }
                        
                        emit RefererPayout(game_id, game.players[p], referers[game.players[p]], referer_payout);
                    }
                }
            }
        }

        if(bank > bank_use) {
            owner.send(bank - bank_use);
        }

        game.finish = true;

        emit GameOver(game_id, numbers);
    }