wrote cachematrix.R