Program updated to invert a matrix