programming assignments 2, caching the inverse of a matrix