     key = e.which #event.which is a function in jquery which returns which key you pressed
     keys = [37..40]
     if key in keys
-      #e.preventDefault()
+      e.preventDefault()
       direction = switch key #the switch function switches the value based upon conditions
         when 37 then 'left'
         when 38 then 'up'

        else if row[a] is row[b]
          row[a] *= 2
          row[b] = 0
        else if row[a] isnt 0
          break
  row

console.log mergeCells([4,4,2,0],'right')
console.log mergeCells([4,0,0,4],'right')
console.log mergeCells([4,4,2,0],'right')

collapseCells = ->
  console.log 'collapse cells'

printArray = (array) ->
  console.log "--start--"

  @board = buildBoard()
  generateTile(@board)
  generateTile(@board)
  printArray(@board)
  showBoard(@board)

  $('body').keydown (e) => #where keydown is the event and everything after (e) is the event handler
