updated the functions in cachematrix.R