Update cachematrix.R

Added the code to complete the function