Update cachematrix.R

Updated for programming assignment 2