     # TODO: Save these to something more global
     @speciesList = (name for name, data of SpeciesData)
     @itemList = _(name for name, data of ItemData).sort() # todo: filter irrelevant items
+    @selected = 0
 
     @listenTo(@collection, 'add', @renderPokemon)
     @listenTo(@collection, 'change:ivs', @renderStats)


    @render()

  clickPokemon: (ev) =>
    $listItem = $(ev.target)
    index = @$('.pokemon_list li').index($listItem)
    @setSelectedIndex(index)


    # PokeBattle.socket.send('save team', teamJson)
    window.localStorage.setItem('team', JSON.stringify(teamJSON))

  changeSpecies: (e) =>
    $list = $(e.currentTarget)
    @getSelectedPokemon().set("name", $list.val())

  changeNature: (e) =>
    $list = $(e.currentTarget)
    @getSelectedPokemon().set("nature", $list.val())

  changeAbility: (e) =>
    $list = $(e.currentTarget)
    @getSelectedPokemon().set("ability", $list.val())

  changeItem: (e) =>
    $list = $(e.currentTarget)
    @getSelectedPokemon().set("item", $list.val())

  changeIv: (e) =>
    # todo: make changeIv and changeEv DRY
    $input = $(e.currentTarget)
    stat = $input.data("stat")
    value = parseInt($input.val())
    if isNaN(value) || value > 31 || value < 0
