cachematrix functions defined