Changed syntax of the range-based loops to the C++ 11 syntax