     $('body').on 'click', '*[data-state-to]', (e)->
       e.preventDefault()
       transitions = $(this).data('state-to').split(/ +/)
-      console.log("transition req:", transitions, sm)
       for to in transitions
         switch
           when to == ':back' then sm.back(1)

#
wizzard = (startState, steps, transitionHandlers={})->
  $steps = (name)-> $(steps[name])
  console.log("steps:", steps)
  handlers = _.extend {}, transitionHandlers,
    "*": (data,from,to)->
      $steps(from).fadeOut(100)

  # Transition to a new state and use the history to figure out which
  # state we came from
  transitionTo = (to, withData={})->
    return unless _.contains(stateList, to)
    from = _.last history
    return if to == from
    _.extend data, withData
    history.push(to)
    runTransitions(from, to, ["leave #{from}", nameOf(from,to),"*", "enter #{to}"])

  # Go back in history
  goBack = (n)-> transitionTo(_.last( history,n)[0] )
