Workable solution

Working solution  for  matrix inverse cache assignment