added some documentation and fixed a bug

Fixed a bug when deleting from the list while iterating over the list
with eachValue()