fixed inversion counter. relied on uncommitted file