when side-effecting, use foreach rather than map
Merge pull request #6 from ornicar/master

when side-effecting, use foreach rather than map