fix counter bug, add win condition