Revised per Dmitri's comments. My first exposure to range-based for loops, thanks!