rework the win function
update win tests