changed for-loop compatible to c++98