Advanced C++ homework 1 - matrix iterator