two functions for 1) making a matrix like object where inversion calcs can be cached, and 2) a function for performing cached inversion on that matrix object