Simplified loops by declaring iterators with 'auto'