Modified the matrix type to store its size as the row size, added some comments