starting to add C++ code for matrix indexing