Update cachematrix.R

Added code for programming assignment