Added functionality to break 3-way ties