wrote assigned functions in cachematrix.R