 
   _continueRun: ->
     @_boldNextLine =>
-      @_executeAndUnboldNextLine =>
-        @_showNextLine =>
-          @refreshDisplays()
-          if @next_line != null
-            @_continueRun()
+      @_executeNextLine =>
+        @_unboldNextLine =>
+          @_showNextLine =>
+            @refreshDisplays()
+            if @next_line != null
+              @_continueRun()
 
   _boldNextLine: (callback) ->
     from = { line: @next_line - 1, ch: 0 }

      @code_mirror.markText from, to, className: 'running'
    @setTimeout callback, MILLIS_FOR_BOLD

  _executeAndUnboldNextLine: (callback) ->
    output = @_executeNextLineGettingOutput()
    $one('div.machine .before-cursor').textContent += output
    @being_bolded_marker.clear()
    @being_bolded_marker = null
    @setTimeout callback, MILLIS_FOR_OUTPUT

  _showNextLine: (callback) ->
    if @next_line

# states: OFF, WAITING, RUNNING
class Machine
  MILLIS_FOR_BOLD = 700
  MILLIS_FOR_OUTPUT = 0
  MILLIS_FOR_UNBOLD = 500
  MILLIS_FOR_MOVED_ARROW = 500

  constructor: (line_height, setTimeout, code_mirror) ->
