Update cachematrix.R

Adding my code for programming assignment 2