Update cachematrix.R

Updated the makeCacheMatrix using the template from the example given for Caching the Mean of a Vector.