Adding invertAffine() function