modify cachematrix.R, implement two func