cacheMatrix for programming assignment 2. Seems to work.