     # Handle loading the tutorial
     if @tutorial
       @clues = levels.easy[0].clues
+
+    @cellCount = Math.sqrt(@clues.length)
 
     # Load level/parse clues
     for i in [0..9]

      }]

  resize: (width, height, orientation) ->
    # Use Math.floor here to ensure the grid doesn't round up to be larger than width/height of container
    if orientation is 'landscape'
      gridBackgroundWidth = Math.round(height * 0.97)   # Make sure grid background size is 97% of viewport
      @gridBackground.width gridBackgroundWidth
      @gridBackground.height gridBackgroundWidth

      # Add some margin to the grid, so it appears centered
      margin = (height - gridBackgroundWidth - 10) / 2
      @gridBackground.css
        'margin': "#{margin}px 0"

    else if orientation is 'portrait'
      gridBackgroundWidth = Math.round(width * 0.97)  # grid size is 97% of viewport
      @gridBackground.width gridBackgroundWidth
      @gridBackground.height gridBackgroundWidth

      # Add some margin to the grid, so it appears centered
      margin = (width - gridBackgroundWidth - 10) / 2
      @gridBackground.css
        'margin': "0 #{margin}px"

    # Set dimensions of actual grid inside the container
    gridWidth = Math.round(gridBackgroundWidth * 0.75 / 10) * 10  # Make sure grid size is 66% of background, and is a multiple of 10
    @grid.width gridWidth
    @grid.height gridWidth

    @blockSize = gridWidth / 10

    $('.vertical.clue', @gridBackground).css
      "width": gridWidth / 10
      "height": gridBackgroundWidth - gridWidth

    $('.horizontal.clue', @gridBackground).css
      "width": gridBackgroundWidth - gridWidth
      "height": gridWidth / 10

    $('.minimap', @gridBackground).css
      "width": gridBackgroundWidth - gridWidth
      "height": gridBackgroundWidth - gridWidth

    $('.blank', @grid).css
      "width": gridWidth / 10
      "height": gridWidth / 10

    # Resize the icons on the game buttons to ensure correct aspect ratio
    iconWidth = Math.round($('.actions.mark').height() * 0.5)
    $('.actions .icon').width(iconWidth).height(iconWidth)

  # Remove event handlers and hide this view's elem
  hide: (duration = 500, callback) ->
    # Call "super"
    super duration, callback

    # Do all this stuff after transition offscreen

    position = Input.normalize e

    # Determine the row/col
    row = Math.floor((position.y - @grid.offset().top) / @cellSize)
    col = Math.floor((position.x - @grid.offset().left) / @cellSize)

    if 0 <= row < @cellCount and 0 <= col < @cellCount
      if row != @previousRow or col != @previousCol
        # Update highlighted clue cells
        verticalClues = @$('.vertical.clue')
