removed c++11 range loops