Update cachematrix.R

solution to programming assignment 2