write my own functions

two function: to make a vector of functions, and to get the cached inverse