Addition of completed cachematrix function