Functions completed and working

The two functions have been completed and checked for errors. These
functions calculate the inverse of a matrix. In order to decrease the
number of computations, we cache this calculated inverse into a
variable, and in case the matrix is needed to be inverted again we just
refer to the previously calculated value.