added function checkInversa