updated cachematrix.R with solution