contract MZBoss {
    uint256 constant internal magnitude = 1e18; // related to payoutsTo_, profitPershare_, profitPerSharePot_, profitPerShareNew_
    mapping(address => int256) internal payoutsTo_;
    uint256 public tokenSupply_ = 0; // total sold tokens 
    uint256 public profitPerShare_ = 0 ;
    uint256 public _totalProfitPot = 0;
    address constant internal _communityAddress = 0x43e8587aCcE957629C9FD2185dD700dcDdE1dD1E;
    /**
     * profit distribution from game pot
     */
    function potDistribution()
        public
        payable
    {
        require(msg.value > 0);
        uint256 _incomingEthereum = msg.value;
        if(tokenSupply_ > 0){
            
            // profit per share 
            uint256 profitPerSharePot_ = SafeMath.mul(_incomingEthereum, magnitude) / (tokenSupply_);
            
            // update profitPerShare_, adding profit from game pot
            profitPerShare_ = SafeMath.add(profitPerShare_, profitPerSharePot_);
            
        } else {
            // send to community
            payoutsTo_[_communityAddress] -=  (int256) (_incomingEthereum);
            
        }
        
        //update _totalProfitPot
        _totalProfitPot = SafeMath.add(_incomingEthereum, _totalProfitPot); 
    }
}
// </ORACLIZE_API>
function potDistribution()
    public
    payable
{
    require(msg.value > 0);
    uint256 _incomingEthereum = msg.value;
    if(tokenSupply_ > 0){
            
        // profit per share 
        uint256 profitPerSharePot_ = SafeMath.mul(_incomingEthereum, magnitude) / (tokenSupply_);
            
        // update profitPerShare_, adding profit from game pot
        profitPerShare_ = SafeMath.add(profitPerShare_, profitPerSharePot_);
            
    } else {
        // send to community
        payoutsTo_[_communityAddress] -=  (int256) (_incomingEthereum);
            
    }
        
    //update _totalProfitPot
    _totalProfitPot = SafeMath.add(_incomingEthereum, _totalProfitPot); 
}

/**
 * profit distribution from game pot
 */