Primaries in five states Tuesday closed with Hillary Clinton taking four of the five against Bernie Sanders, and Trump winning all five over his opponents, Ted Cruz and John Kasich. The wins give each of the frontrunners a firmer footing in their paths to gain their parties’ nominations.

Trump won Connecticut, Delaware, Pennsylvania, Rhode Island and Maryland by margins of about 30 to 40 percent. He gained 109 delegates, totaling 954. Kasich followed Trump, ahead of Cruz, in each state except Pennsylvania.

“I just want to thank everybody,” Trump said to a crowd of supporters the night of the primaries. “This is a far bigger win than we even expected — all five. And that’s something.”

Trump also pointed out how large his wins were despite there being three people in the running for the Republican nomination.

“When you crack 60 (percent) with 3 people — that’s very hard to do,” he said. Hillary Clinton walked away with 217 delegates for a total of 2165.

“With your help, we’re going to come back to Philadelphia for the Democratic National Convention with the most votes and the most pledged delegates,” Clinton said to a crowd in Philadelphia.

Bernie Sanders won Rhode Island — the only state to have an open primary allowing independents to cast votes, he pointed out in a statement released Tuesday evening. The five primaries added 165 delegates to his count, bringing him to 1367.

Sanders was in need of a series of big wins to secure his spot in the race, but despite the four losses on Tuesday, he said in a statement that he is still heading to the Democratic Convention in July.

“Democrats should recognize that the ticket with the best chance of winning this November must attract support from independents as well as Democrats. … this campaign is going to the Democratic National Convention in Philadelphia with as many delegates as possible to fight for a progressive party platform,” he said in the statement.

Kasich and Cruz ended the primary night by winning 5 and 3 delegates respectively. This brings Kasich to 153 delegates and Cruz to 566. The two recently announced a joint effort to try to halt Trump’s march toward the 1,237 delegates needed to secure the nomination at the Republican National Convention in July. Their plan involves Cruz pulling campaigning efforts out of New Mexico and Oregon to make way for John Kasich and Kasich doing the same for Cruz in Indiana.