       [hypState, hypMy] = state.hypothetical(my.ai)
       # technically, we don't want to discard but to put back, but for pessimisticBuy this should not matter
       dis = hypState.requireDiscard(hypMy, 1)
-      state.log("Discarded: #{dis}")
       defaultGained = hypMy.ai.pessimisticCardsGained(hypState)
-      state.log("Defaultgain: #{defaultGained}")
       
       # determine which treasures are in hand, discard them hypothetically and test if the gains change.  When it doesn't, we can put back this card.
       treasures = []

        if (card.isTreasure) and (not (card in treasures))
          treasures.push card
            
      for card in treasures
        [hypState, hypMy] = state.hypothetical(my.ai)
        hypMy.doDiscard(card)
        nowGained = hypMy.ai.pessimisticCardsGained(hypState)
        state.log("card #{card}, HypGaines: #{nowGained}")
        # test arrays on equality. Better way?
        # changed order in gaining messes this up. Just ignore?
        equal = true

      else if state.phase == 'treasure'
        state.phase = 'buy'
    
    [hypothesis, hypothetically_my] = state.hypothetical(this)
    #  We need to save draw and discard before emptying and restore them before buyPhase, to be able to choose the right buys in actionPriority(state)
    oldDraws   = hypothetically_my.draw.slice(0)
    oldDiscard = hypothetically_my.discard.slice(0)
    hypothetically_my.draw = []
    hypothetically_my.discard = []
    
    while hypothesis.phase != 'buy'
      hypothesis.doPlay()
      
    hypothetically_my.draw = oldDraws
    hypothetically_my.discard = oldDiscard

    return hypothesis
  
  pessimisticCardsGained: (state) ->
