     this.tokenIterator(tokenIndex, modifier, selected)
 
   changeTokenKind: (kind) ->
+    this.lastUsedLabel = kind
     return if this.selectedTokenIndex < 0
 
     modifier = (token, kind) ->

      this.tokens[targetIndex].leftSiblingIndex = mostOuterTokenIndex

  addNewToken: ($token, index) ->
    _this.addTokenToList($token, 'PER', index, -1)
    $token.addClass('left-end')
    $token.addClass('right-end')
    this.changeChunkState(this.selectedTokenIndex, false)


    this.selectedTokenIndex = siblingIndex if this.selectedTokenIndex == indexToRemove

  removeChunkWithIndex: (tokenIndex, selectNextChunk=true) ->
    mostOuterTokenIndex = this.getMostOuterTokenIndexFromChunk(tokenIndex, 'left')
    this.removeChunkWithStartIndex(mostOuterTokenIndex, selectNextChunk)

  removeChunkWithStartIndex: (mostLeftOuterTokenIndex, selectNextChunk=true) ->
    modifier = (token, selected) ->
      token.$token.removeClass('PER COM left-end right-end selected')
      token.$token.data('token-id', -1)
