shitty first draft of ring buffer, missing functionality and tests