added function to cachematrix.R