```coffeescript
$ ->
  saveSequence = (sequence) ->
    if sequence?
      localStorage.setItem('sequence', sequence)
    true

  loadSequence = ->
    localStorage.getItem('sequence')

  input    = $("input#fragment")
  button   = $("#methods button")
  sequence = loadSequence()

  if sequence?
    input.val(sequence)

    unless window.location.search
      button.click()

  button.on "click", ->
    val = input.val()
    saveSequence(val)

  false
```

Save sequence if location.search exists
user
```coffeescript
$ ->
  saveSequence = (sequence) ->
    if sequence?
      localStorage.setItem('sequence', sequence)
    true

  loadSequence = ->
    localStorage.getItem('sequence')

  button = $("#methods button")
  input  = $("input#fragment")

  $(window).on "load", (e) ->
    search = window.location.search

    if search
      val = input.val()
      saveSequence(val)
    else
      sequence = loadSequence()

      if sequence?
        input.val(sequence)
        button.click()

  button.on "click", ->
    val = input.val()
    saveSequence(val)

  false
```
assistant