     @recordComplete(name)
     this
 
-  reset: =>
+  reset: ->
     @removeVariantCookie()
     @removePersistCompleteCookie()
     @result = null

    # Set the variant we chose as a cookie
    @setVariantCookie(variant.name)

  recordComplete: (name) =>
    # Record the experiment was completed on the server
    request("#{@endpoint}/complete", experiment: @name, variant: name)

  # Variant Cookie

  getPreviousVariant: =>
    if name = @getVariantCookie()
      @getVariantForName(name)

  getVariantCookie: =>
    @getCookie("abbaVariant_#{@name}")

  setVariantCookie: (value) =>
    @setCookie("abbaVariant_#{@name}", value, expires: @options.expires)

  removeVariantCookie: =>
    @setCookie("abbaVariant_#{@name}", '', expires: true)

  # Complete Cookie

  setPersistCompleteCookie: =>
    @setCookie("abbaPersistComplete_#{@name}", '1', expires: @options.expires)

  hasPersistCompleteCookie: =>
    !!@getCookie("abbaPersistComplete_#{@name}")

  removePersistCompleteCookie: =>
    @setCookie("abbaPersistComplete_#{@name}", '', expires: true)

  setCookie: (name, value, options = {}) ->

    @variants.push(options)
    this

  control: (name = 'Control', options, callback) ->
    if typeof options isnt 'object'
      callback = options
      options  = {}
