adding code to cachematrix functions