Final code

Code for matrix inversion and caching.