composed cachematrix functions