finalized win logic