added code to cachematrix.R file