Changed Atlas indexing, implemented C++11 loops here and there