i was thinking, wouldn't a hashtable work for this the best way?

here's how i'd like for it to work...

there's about 5 line "buffer" the new line they just typed goes to 5.. 5 to 4 , 4 to 3 , 3 to 2, 2 to 1, 1 to unset.

anyway to do this ?