assignment2 - cache inverse matrix