My version of cachematrix functions