Stanford wins in grind-it-out fashion