Update cachematrix.R

Added code to complete the assignment