 
       setTimeout ->
         bar.finish()
-      , Math.max(GHOST_TIME, Math.min(MIN_TIME, now() - start))
+      , Math.max(options.ghostTime, Math.min(options.minTime, now() - start))
     else
       enqueueNextFrame()
 
-do check = ->
+Pace.start = ->
   bar.render()
 
   # It's usually possible to render a bit before the document declares itself ready
   if not document.querySelector('.pace')
-    setTimeout check, 50
+    setTimeout Pace.start, 50
   else
-    go()
-
+    Pace.go()
+
+if typeof define is 'function' and define.amd
+  # AMD
+  define -> Pace
+else if typeof exports is 'object'
+  # CommonJS
+  module.exports = Pace
+else
+  # Global
+  Pace.start()

      if @sinceLastUpdate
        @rate = (val - @last) / @sinceLastUpdate

      @catchup = (val - @progress) / CATCHUP_TIME

      @sinceLastUpdate = 0
      @last = val

    if val > @progress
      # After we've got a datapoint, we have CATCHUP_TIME to
      # get the progress bar to reflect that new data
      @progress += @catchup * frameTime

    scaling = (1 - Math.pow(@progress / 100, EASE_FACTOR))

    # Based on the rate of the last update, we preemptively update
    # the progress bar, scaling it so it can never hit 100% until we

      <div class="pace-progress">
        <div class="pace-progress-inner"></div>
      </div>
      <div class="pace-activity"></div>
      '''

      if document.body.firstChild?
        document.body.insertBefore @el, document.body.firstChild
