edited cachematrix w first function not tested in R, yet