We add an extra function that implements matrix multiplication and sum