Updating functions to cache matrix and its inverse