Write cachematrix.R