win logic and tie logic work