       rowIndex = row * @cellCount + i
       columnIndex = i * @cellCount + col
 
-      if blocks.eq(rowIndex).hasClass('filled') then completedRowTotal++
-      if blocks.eq(columnIndex).hasClass('filled') then completedColumnTotal++
-
-      if @clues[rowIndex] is 1 then rowTotal++
-      if @clues[columnIndex] is 1 then columnTotal++
-
-    if rowTotal == completedRowTotal then @$('.horizontal.clue', @elem).eq(row).addClass('complete')
-    if columnTotal == completedColumnTotal then @$('.vertical.clue', @elem).eq(col).addClass('complete')
+      if blocks.eq(rowIndex).hasClass('filled')
+        completedRowTotal += 1
+      if blocks.eq(columnIndex).hasClass('filled')
+        completedColumnTotal += 1
+
+      if @clues[rowIndex] is 1 then rowTotal += 1
+      if @clues[columnIndex] is 1 then columnTotal += 1
+
+    if rowTotal is completedRowTotal
+      @$('.horizontal.clue', @elem).eq(row).addClass('complete')
+    if columnTotal is completedColumnTotal
+      @$('.vertical.clue', @elem).eq(col).addClass('complete')
 
   # Actions when player solves the puzzle
   win: ->

  # Go back to the level select screen
  pause: (e) ->
    e?.preventDefault()

    # Handle a case when this "pause" method is called when user puts app into background
    if @ignoreInput is true then return

    @ignoreInput = true


      # Check if user placed the correct rect
      switch @tutorialStep
        when 4
          # Ensure first column is filled correctly
          stepCompleted = true
          for i in [0, 5, 10, 15, 20]
            if blocks.eq(i).hasClass('filled') is false then stepCompleted = false
          success = stepCompleted
        when 8
          # Ensure 3rd column is filled correctly
          stepCompleted = true
          for i in [2, 12, 22]
            if blocks.eq(i).hasClass('filled') is false then stepCompleted = false
          success = stepCompleted
        when 11
          # Ensure 3rd column is marked correctly
          stepCompleted = true
          for i in [7, 17]
            if blocks.eq(i).hasClass('marked') is false then stepCompleted = false
          success = stepCompleted
        when 12
          # Ensure 4th column is filled correctly
          stepCompleted = true
          for i in [3, 13, 18, 23]
            if blocks.eq(i).hasClass('filled') is false then stepCompleted = false
          success = stepCompleted
        when 13
          # Ensure 5th column is all marked
          stepCompleted = true
          for i in [4, 9, 14, 19, 24]
            if blocks.eq(i).hasClass('marked') is false then stepCompleted = false
          success = stepCompleted
        when 15
          # Ensure 1st row is filled correctly
          stepCompleted = true
          for i in [0...4]
            if blocks.eq(i).hasClass('filled') is false then stepCompleted = false
          success = stepCompleted
        when 16
          # Ensure rest of squares marked correctly
          stepCompleted = true
          for i in [6, 7, 8, 11, 16, 17]
            if blocks.eq(i).hasClass('marked') is false then stepCompleted = false
          success = stepCompleted

      if success
        @tutorialStep += 1
        @showTutorial()


