minor changes, list iterators refactored to enhanced for loops