Added std namespace for brevity.
Made a few iterator declarations local to a loop.

Reducing variable scope whenever possible is never a bad idea.