Fixed bug related to invalid matrix b/c of b. size

When print was called, it was using the same index as the
main function. Thus, the indeces were made private for each function.