function get_PendingGains( address _player_address , uint256 _gRND) private view
    returns( uint256)
    {
       
       
       if (PlayerData[ _player_address].gRND != _gRND || _gRND==0) return( 0 );
       
       GameRoundData_s storage  _GameRoundData = GameRoundData[ _gRND ];
       
     
       uint32 _winner = _GameRoundData.extraData[1];
       
       uint256 _gains = 0;
       uint256 _treasure = 0;
       uint256 _sharePrice = _GameRoundData.sharePrice;
       uint256 _shares;
       
       PlayerGameRound_s storage  _PlayerGameRound = PlayerGameRound[ _player_address][_gRND];
       
       for(uint i=0;i<4;i++)
       {
           _shares = _PlayerGameRound.shares[ i ];
            
           _gains = _gains.add( _shares.mul( _sharePrice) / magnitude );
        
           
           _treasure = _treasure.add(_shares.mul( _GameRoundData.treasurePerShare[ i ] ) / magnitude);
           
       }
       
        if (_treasure >=  _PlayerGameRound.treasure_payoutsTo) _treasure = _treasure.sub(_PlayerGameRound.treasure_payoutsTo );
       else _treasure = 0;
           
       _gains = _gains.add(_treasure );
       
       
       if (_winner>0 && _GameRoundData.extraData[0] >= (1<<30))
       {
           _shares = _PlayerGameRound.shares[ _winner-1 ];
           
           if (_shares>0)
           {
               
               _treasure = (_GameRoundData.treasureSupply.mul( _sharePrice )) / magnitude;
       
               
               _gains = _gains.add(  _treasure.mul( _shares ) / _GameRoundData.sharePots[ _winner-1]  );
               
           }
           
       }
    
       
        return( _gains );
        
    }