cache inverse matrix solution

Marcial Rivas solution