loop simplification in code
doc: typos