refactored back to ringbuffer object