use c++11 ranged loops