my attempt at writing a program to cache the inverse of a matrix