solve functions of cachematrix.R