use pre-increment in iterator loops
range based for loops for better readability