removed ringbuffer since there is a similar implementation in Java