added codes to cachematrix.R