added code to cachematrix.R