functions programmed in cachematrix.R file