non working solution only finds inversions next to each other