Wrote the cacheSolve function.