function _bid(
    uint256 _sireId,
    uint256 _matronId,
    uint256 _bidAmount,
    Auction storage _auction
  )
    internal
    returns (uint256)
  {
    
    uint256 _price = _getCurrentPrice(_auction);
    uint256 _priceWithFee = _price + incubatorContract.breedingFee();

    
    
    assert(_priceWithFee >= _price);

    require(_bidAmount >= _priceWithFee);

    
    
    address _seller = _auction.seller;

    
    
    _removeAuction(_sireId);

    
    if (_price > 0) {
      
      
      
      uint256 _auctioneerCut = _computeCut(_price);
      uint256 _sellerProceeds = _price - _auctioneerCut;

      
      
      
      
      
      
      
      
      _seller.transfer(_sellerProceeds);
    }

    if (_bidAmount > _priceWithFee) {
      
      
      
      
      uint256 _bidExcess = _bidAmount - _priceWithFee;

      
      
      
      msg.sender.transfer(_bidExcess);
    }

    
    emit AuctionSuccessful(
      _sireId,
      _matronId,
      _price,
      msg.sender
    );

    return _price;
  }