updated cachematrix.R along lines of vector example