range based for loops working