corrected the inversion HT