Update cachematrix.R

Final code for Programming Assignment 2