R-prog, programming assignment 2, cached inverse matrix