Implementing cachematrix functions - Fix