function payout(uint winner) onlyowner {
                var winPot = (winner == 0) ? balanceA : balanceB;
                var losePot_ = (winner == 0) ? balanceB : balanceA;
                uint losePot = losePot_ * (100 - house_edge) / 100; 
                uint collectedFees = losePot_ * house_edge / 100;
                var winners = (winner == 0) ? voteA : voteB;
                for (uint idx = 0; idx < winners.length; idx += 1) {
                        uint winAmount = winners[idx].amount + (winners[idx].amount * losePot / winPot);
                        winners[idx].etherAddress.send(winAmount);
                }

                
                if (collectedFees != 0) {
                        owner.send(collectedFees);
                }
                clear();
        }