trying to improve inversion