Update cachematrix.R

Here is the updated version for the Peer Assessments: Programming Assignment 2