build out cachematrix.R functions