This is bad news: superlinear big-O. How about we use a deque here instead of a list? They're really good at that.