reading matrices