This holds some modifications performed on a circular buffer implementation pulled from StackOverflow/Wikipedia.  It's some kind of Creative Commons license, technically.  We're assuming CC is non-infectious. http://creativecommons.org/licenses/by-sa/3.0/ and http://en.wikipedia.org/w/index.php?title=Circular_buffer&oldid=632513240