for() is just syntatic sugar over while(), and it was prettier in this context (i thought)

not sure how to do a buffered read, so i didn't. either of us could redo this for efficiency later (or now, if you'd like). The unit tests will keep us from breaking sh*t.