added check for winner to the first if statement