complete matrix inverse
complete matrix inverse with minor change