moved the inversions out of the drive loop