Code added to cache matrix and solve

Adapted example code to take matrix and store matrix and calculate the
inverse instead of a mean.