     progress = timestamp - @startTime
       
     # to ease or not to ease is the question
-    if @useEasing
+    if @options.Easing
       if @countDown
-        i = @easeOutExpo progress, 0, @startVal - endVal, @duration
+        i = @easeOutExpo progress, 0, @startVal - @endVal, @duration
         @frameVal = @startVal - i
       else
-        @frameVal = @easeOutExpo(progress, @startVal, endVal - @startVal, @duration)
+        @frameVal = @easeOutExpo(progress, @startVal, @endVal - @startVal, @duration)
     else
       if @countDown
-        i = (startVal - endVal) * (progress / @duration)
+        i = (@startVal - @endVal) * (progress / @duration)
         @frameVal = @startVal - i
       else
-        @frameVal = @startVal + (endVal - @startVal) * (progress / @duration)
+        @frameVal = @startVal + (@endVal - @startVal) * (progress / @duration)
         
     # decimal
     @frameVal = Math.round(@frameVal * @dec) / @dec
 
     # don't go past enVal since progress can exceed duration in last grame   
     if @countDown
-      @frameVal = if (@framVal < endVal) then endVal else @frameVal
+      @frameVal = if (@framVal < @endVal) then @endVal else @frameVal
     else
-      @frameVal = if (@framVal > endVal) then endVal else @frameVal
+      @frameVal = if (@framVal > @endVal) then @endVal else @frameVal
 
     # formate and print value
-    @doc.innerHTML = @addCommas @frameVal.toFixed(decimals)
+    @doc.innerHTML = @formatNumber @frameVal.toFixed(decimals)
 
     # weather to continue
     if progress < @duration

    @startVal = @framVal
    requestAnimationFrame @count

  @addCommas = (nStr) ->
    nStr += ''
    x = nStr.split('.')
    x1 = x[0]
    x2 = if x.length > 1 then "." + x[1] else ''
    rgx = /(\d+)(\d{3})/

    while rgx.test(x1)
      x1 = x1.replace(rgx, '$1' + ',' + '$2')

    x1 + x2

  # format startVal on initialization
  @doc.innerHTML = @addCommas @startVal.toFixed(decimals)

###

# target = id of Html element where counting occurs
# @startVal = the value you want to start at
# @endVal = the value you want to arrive at
# decimals = number of decimal places, default 0
# duration = duration of animation in seconds, default 2
# options = optional object of options (see below)

countUp = (target, startVal, endVal, decimals, duration, options) ->

  # default options
  @options = option || { 
    useEasing: true # toggle easing
    useGrouping: true # 1,000,000 vs 1000000
    separator: ',' # character to use as a separator
    decimal: '.' # character to use as a decimal
  }

  lastTime = 0
  vendors = [
