updated cachematrix.R for programming assingment 2