updated cachematrix with two functions