Moved printMatrix method to a utility class.