Added option 'inversion' for repeat