Added a circular buffer class