timer and circular buffer - untested