updated cachematrix.R with completed code