working except for three-way ties