handle duplicate positions with different heights