script to cache matrix and its inverse