anchor.diff:      updateTotalDeckCost()
     }
   
  -  var updateCardMax = function(card) {
  -     userDeckMaxes = getUserDeckMaxes() 
  -     return (card.user_max = _.reduce(card.packs, function(memo, pack) {
  -        return memo + pack.amount * userDeckMaxes[pack.pack_name]
  -     },0))
  -  }
  -
     var updateListCardMaxTr = function(tr) {
       var tr = $(tr)
       var card = $(tr).data('card')
  -    updateCardMax(card) 
           
  -    var maxText = (card.user_max < card.deck_max) ? "" + card.user_max + "/" + card.deck_max : card.deck_max
  +    var user_max = card.user_max()
  +    var maxText = '' + user_max
  +    if(user_max != card.deck_max) {
  +      maxText += '/' + card.deck_max
  +    }
   
       $('td.max', tr).text(maxText)
     }
   
     var updateDeckAmountTr = function(tr) {
       var tr = $(tr)
  -    var card = $(tr).data('card')
  -    if(card) {
  -      if(!card.deck_amount) {
  -         card.deck_amount = 1
  -      }
  -      updateCardMax(card) 
  -
  -      var max = _.min([card.deck_max, card.user_max])
  -      card.deck_amount = _.min([max, card.deck_amount])
  -      var td = $('td.amount', tr).empty()
  -      if(max === 1) {
  -        td.text('1') 
  -      } else {
  -         var select = $('<select/>').appendTo(td).change(function() {
  -           card.deck_amount = parseInt($(this).val())
  -           updateDeckTr(tr)
  -           updateTotalDeckCost()
  -         })
  -
  -         for(i = 1; i <= max; i++) {
  -           var op = $('<option/>').val(i.toString()).text(i).appendTo(select)
  -           if(i == card.deck_amount) {
  -              op.attr('selected', 'selected')
  -           }
  +    var card_entry = deck.get(tr.data('code'))
  +    var max = card_entry.card.user_max()
  +
  +    var td = $('td.amount', tr).empty()
  +    if(max === 1) {
  +      td.text('1') 
  +    } else {
  +       var select = $('<select/>').appendTo(td).change(function() {
  +         var card_entry = deck.get(tr.data('code'))
  +         card_entry.amount = parseInt($(this).val())
  +         updateDeckTr(tr)
  +         updateTotalDeckCost()
  +       })
  +
  +       for(i = 1; i <= max; i++) {
  +         var op = $('<option/>').val(i.toString()).text(i).appendTo(select)
  +         if(i == card_entry.amount) {
  +            op.attr('selected', 'selected')
            }
  -      }
  -      updateDeckTr(tr)
  -    }
  +       }
  +    }
  +    updateDeckTr(tr)
     }
   
     var updateCardMaxes = function() {
  
positive.code:         return memo
        }, {})
      }
   
      var listTable = $("#card_list_table").dataTable({
        bServerSide: true,
        sAjaxSource: '/cards',
  
negative.code:   }, 1000)
  
    $('#card_list_table').on('click', 'tbody tr button', function() {
      var tr = $(this).closest('tr')
      var listCard = tr.data('card')
      var card_entry = deck.add(listCard)
      var tr = getDeckTr(listCard.code)
      if(tr.length > 0) {
        updateDeckAmountTr(tr)
      } else {
        deckTable.dataTable().fnAddData(listCard)
  