Initial review

The most recent commit message is so accurate.

Popping from the front of a list is O(n) in the size of the list, making this loop O(n^2).  We should avoid that for user-supplied data if we can help it.  Refactor to use an index variable rather than popping, or to process chunks from the back of the list first.