Update cachematrix.R

The revision has the logic and comments included