adding cachematrix functions