implemented functions cachematrix.R