starting on a generic ring-buffer implementation