anchor.diff:                        id: 'toggle-all'
                         type: 'checkbox'
                         init: -> @change =>
  -                        for task in todoList.tasks.all()
  +                        for task in tasks.all()
                             task.isCompleted.set(@is(':checked'))
                       }
                       label {for: 'toggle-all'}, ['Mark all as complete']
  -                    ul {id: 'todo-list'}, todoList.tasks.map (task) ->
  +                    ul {id: 'todo-list'}, tasks.map (task) ->
                         li {
  -                        class: bind ->
  -                          cls = []
  -                          cls.push('completed') if task.isCompleted.get()
  -                          cls.push('editing') if task.isEditing.get()
  -                          cls.join(' ')
  +                        class: bind -> [
  +                          'completed' if task.isCompleted.get()
  +                          'editing' if task.isEditing.get()
  +                        ].filter((x) -> x?).join(' ')
                         }, do ->
                           if task.isEditing.get() then [
                             input {
  
positive.code:                 autofocus: true
                  init: -> @keydown (e) =>
                    if e.which == 13
                      todoList.tasks.push(new Task(@val().trim()))
                      @val('')
                }
              ]
              div {}, bind ->
                if todoList.tasks.length() == 0
                  []
                else
                  [
  
negative.code:                           }, bind -> ["#{task.title.get()}"]
                            button {
                              class: 'destroy'
                              init: -> @click -> tasks.remove(task)
                            }
                          ]
                    ]
                    footer {id: 'footer'}, [
                      span {id: 'todo-count'}, bind -> [
                        strong {}, ["#{incomplete()}"]
                        if incomplete() == 1 then ' item left' else ' items left'
                      ]
                      button {
                        id: 'clear-completed'
                        init: -> @click =>
                          tasks.replace(task for task in tasks.all() when not task.isCompleted.get())
                      }, ['Clear completed']
                    ]
                  ]
  