definition of functions in cachematrix.R file