creating cache matrix, inverting and caching inverse