check winner function added.