add inversion and logging