add foreach, cleanup some comments
minor cleanup