 	next:  ->
 		# TODO: maybe add animationOptions
 		states = Utils.arrayFromArguments arguments
-		
+
 		if not states.length
 			states = @states()
-		
+
 		@switch Utils.arrayNext(states, @_currentState)
 
 
 	last: (animationOptions) ->
 		# Return to last state
 		@switch _.last(@_previousStates), animationOptions
-


		animationOptions ?= @animationOptions
		animationOptions.properties = {}
		
		animatingKeys = @animatingKeys()

		for k, v of @_states[stateName]

		@_states[stateName] = properties

	remove: (stateName) ->

		if not @_states.hasOwnProperty stateName
			return

		delete @_states[stateName]
		@_orderedStates = _.without @_orderedStates, stateName

	switch: (stateName, animationOptions) ->

		# Switches to a specific state. If animationOptions are
		# given use those, otherwise the default options.

		if stateName is @_currentState
			return

		if not @_states.hasOwnProperty stateName
			throw Error "No such state: '#{stateName}'"

		@emit "willSwitch", @_currentState, stateName, @

		@_previousStates.push @_currentState
