Update cachematrix.R

working solution