         promise = fn.call(nested_context)
         promise.done ->
           $item.attr 'data-async-status', "loaded in #{duration()}"
-          scroll_to_result $top
+          scroll_to_top()
         promise.fail ->
           $item.attr 'data-async-status', "failed in #{duration()}"
-          scroll_to_result $top
+          scroll_to_top()
 
     run_context.cli = cli = bind_cli run_context
 
-    run_in_context run_context, string
-
-    scroll_to_result $top
-
-    output_cell
+    run_context
 
   run_in_context = (run_context, string) ->
     try


  run = (input_cell, string) ->
    output_cell = create_output_cell input_cell.notebook
    $top = input_cell.$el

    scroll_to_result = ($result)->
      top = if $result?
        $result.offset().top
      else
        $(document).height()

      setTimeout ->
        $('html, body').scrollTop top
      , 10

    result_handlers =[

      current_options: {}
      default_options: notebook.default_options
      output: output output_cell.$el
      scroll_to_top: scroll_to_top
      functions: lead.define_functions {}, graphite_function_names
      vars: lead: {github, graphite, colors}
      set_code: (code) ->
