updating cachematrix with function code