Implemented functions to created cached matrices and to invert them.