Added an inverse helper for matrix