         scheme.slots = {}
         for obj, idx in slotsArray
           scheme.slots[idx] = obj.slot
+        scheme.next = parseInt(_.max(_.keys(scheme.slots))) + 1
         saveDataFile()
         programDone()
 

        data =
          currentScheme: "default"
          color: true
          schemes: {}
          history:
            slots: []
            max: 10

        initalizeScheme "default"
      {currentScheme, history} = data
      chalk.enabled = colors = (if data.color? then data.color else true)
      fatalError("currentScheme property is missing in data.json") unless _.isString(currentScheme)
      scheme = data.schemes[currentScheme]

      args.shift()
      commands[cmd].apply(this, args)
      disableExit = false

    doAutoCompact = () ->
      schemeMsg "auto compacting is enabled"
      callCommand "compactSlots"

    # eval "$(./app.js init)"
    commands =
