find the index of mass difference