Prof. Kris helped to add an alternative in case of error for inverse of a matrix.