diff --git a/functions.py b/functions.py
index 1da891145d0b2fcf6cb84c5b8189ff75527689c8..7eded801250ff8cf0a04ddf2851cf97cd1d2e525 100644
--- a/functions.py
+++ b/functions.py
@@ -143,8 +143,8 @@ class MatMul(_Function):
         # TODO: Implement the derivative dx for this opetation and add the
         # result of the chain rule on self.dx.
         #######################################################################
-        self.dx = np.add(self.x.data.transpose(), self.y.data)
-        self.dy = np.add(self.x.data, self.y.data.transpose())
+        self.dx = np.add(self.x.data, self.y.data.transpose())
+        self.dy = np.add(self.x.data.transpose(), self.y.data)
         #######################################################################
         # --------------------------- END OF YOUR CODE ------------------------
         #######################################################################