Update to cacheMatrix.r

This was done to complete assignment 2 for the R Programming course offered at coursera.