Merge pull request #1 from llazzaro/master

Update from original
Bugfix: don't change list while iterating through it.
Merge pull request #87 from drodger/master

List iteration and remove() call.