Added logic for determine winners