   pop : ->
     @values.pop()
     @trigger 'pop'
+
+  shift : ->
+    @trigger 'shift', @values.shift()
 
   each : (fn, context) ->
     _.each(@values, (v) =>

    if (_? && typeof _ == "function") == false
      throw new Error "Underscore.js is required"

  set : (value) ->
    @values.push value
    @trigger 'set', value

  get : (index) ->
    val = @values[index] if @values[index]?

  toString : ->
    @values.toString()

  setBuffer : (@buffer_length) ->
    if @values.length > 0 && @values.length > @buffer_length
      @shift v for v in @values.slice(0, @values.length - @buffer_length)


# Do some checking of the global space to see if we're in AMD /
# Node.js land
