create a tie condition with help from Toan