How about using a ringbuffer instead of the linkedlist while we are at it?