added circular buffer class