Written cachematrix.R function defintions