initial implementation of cachematrix.R