implemented winner determination