created functions to make inverse matrices cacheable