code cleanup in inverse iterations