somewhat fixed the tie conditional