add curly brackets around oneliner if statements
fix range check of iterators