update circular buffer. add test file.