Calculate inverse including comments