Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators