example given in programming assignment
cache matrix inversion