Solved prog. assignment 2: create cachematrix - lexical scoping