Update cachematrix.R

My solution to the 2nd programing assignment