Implemented circular buffers for keyboard input