Add circular buffer

Only passing 2/10 test cases. It's something.