created functions to get the inverse of a given matrix