untested script for caching matrix inverse