Matrix Implementation in C++