Update cachematrix.R

solution to the programming assignment 2