finished cachematrix program - calculate the inverse matrix and cache it