Guatemalans head to the polls to pick a new president on September 6, but someone else will already have taken the helm by then. Months of scandal and demonstrations culminated in President Otto Pérez Molina’s signing a resignation letter on September 2, a day after Guatemala’s Congress stripped him of immunity.

Protests calling for Pérez Molina to step down date back months, to when Vice President Roxana Baldetti resigned for her role in the customs fraud scandal known as La Línea. The president’s approval rating sank to a dismal 12 percent but he managed to stay just out of the scandal’s reach.

That all changed starting August 21, when new revelations tying Pérez Molina to La Línea emerged and the UN-backed International Commission against Impunity in Guatemala (CICIG) and attorney general took steps toward the president’s impeachment.

One by one the dominoes fell, as did the president. A few hours after a judge issued a warrant for his arrest on Wednesday, Pérez Molina did exactly what he said repeatedly that he would not do—he stepped down. He did, however, maintain that he was innocent. Alejandro Maldonado Aguirre, who replaced Baldetti as vice president, is expected to take Pérez Molina’s place until the next president’s inauguration in January 2016.

The scandals could affect the elections as well, particularly with candidates also linked to corruption cases. While some have suggested that, given the current political climate, the first-round vote on September 6 should be postponed, the Organization of American States urged Guatemala to stick to the date.

Here’s what you need to know about Guatemala’s current political turmoil and the upcoming election.

Timeline: What are the recent developments leading to the present crisis?

August 21: Authorities take Baldetti into custody and investigators claim they have enough evidence to go after the president as a La Línea ringleader.

August 22: Several ministers quit over the prior day’s news. The economy and education ministers were among them and used words like “disillusioned” and “betrayed” to describe their response over the government’s ties to corruption.

August 24: In Baldetti’s first hearing, an audio clip of a wiretap is played in which Pérez Molina gives instructions benefiting the La Línea criminal ring. Guatemala’s finance and communications secretaries resign as well.

August 25: Guatemala's Supreme Court backs the attorney general's request to impeach the president. Separately, Baldetti was formally charged for her role in the graft scandal.

August 27: The country witnesses the largest protest in its history, reports Nómada. Some 100,000 people turn out into the streets against corruption using the hashtag #NoTengoPresidente (#IDontHaveAPresident).

September 1: In a unanimous vote, the 132 deputies present in Congress vote to end the president's presidential immunity for the first time in Guatemala's history, paving the way for him to face prosecution for his role in La Línea and be forced out of office.

The general elections are slated for September 6. Guatemalans will cast ballots for president and vice president, 158 congressional deputies, 20 deputies to the Central American Parliament (known as Parlacen), as well as mayors and other local roles in the country’s 337 municipalities. If no candidate wins a majority of the votes, the top two candidates will face off in a second round on October 25.

The winner is scheduled to take the reins from Pérez Molina on January 14, 2016. Guatemala’s Constitution does not allow for presidential reelection. Presidents serve four-year terms.

Who is Otto Pérez Molina, who is the vice president replacing him, and who are the top candidates in the electoral race?

Otto Pérez Molina served as a general during Guatemala’s brutal civil war, which spanned more then three decades and claimed tens of thousands of lives. He won in 2011 with a platform pledging mano dura (“iron fist”) policies to crack down on crime. But, in a surprise move, within the first week of office he began making calls for drug policy reform and decriminalization. Since April he has faced ongoing protests over the executive branch's connections to La Línea scandal. He stepped down after he was stripped of immunity and arrested under suspicion that he served as a ringleader in the scandal.

Pérez Molina's likely successor will be current Vice President Alejandro Maldonado Aguirre, appointed in May to replace Baldetti. Maldonado served on the constitutional court, where he handed down several controversial rulings, including the decision to overturn the guilty verdict in the human rights case against former dictator Efraín Ríos Montt. On August 24 Maldonado tweeted what is thought to be a vague criticism of Pérez Molina by writing an Abraham Lincoln quote: “You cannot fool all the people all the time.”

Manuel Baldizón, representing the Renewed Democratic Liberty (LIDER) party, is the frontrunner in the presidential race. A wealthy businessman and former legislator, he lost to Pérez Molina in a 2011 runoff vote. History gives this year’s win to Baldizón; since 1986, the candidate finishing second went on to win the succeeding Guatemalan presidential election. On the other hand, he’s not escaping scandal’s reach either, given that prosecutors say his running mate Edgar Barquín ran a money-laundering scheme while head of the Central Bank. The Supreme Court opted to strip Barquín of immunity earlier this month. Baldizón, a conservative populist who has been accused of plagiarism, saw his poll numbers slip somewhat since April. His slogan "Le toca" ("It's his turn") backfired on social media via the hashtag #NoTeToca (#ItsNotYourTurn). There has been speculation that, should he win, Baldizón will protect Pérez Molina. Several LIDER deputies were absent from Congress on September 1 in an attempt to prevent a vote stripping the president of immunity, and the party also played a role in blocking a prior vote to do so.

Discontent over corruption is working to the benefit of Jimmy Morales, an actor and a candidate for the National Convergence Front (FCN), who polls behind Baldizón. Some see him as a candidate in the right place at the right time as he falls outside a discredited political establishment. Morales, who ran as a mayoral candidate for the municipality of Mixco in 2011, supports the death penalty, opposes abortion, and denies that genocide occurred against Guatemala’s Ixil Mayan group.

Sandra Torres, a former first lady, is another top candidate and represents the center-left National Union of Hope (UNE). During the 2011 election, she divorced then-President Álvaro Colom in a failed bid to avoid a constitutional ban preventing close family members from running for the top office.

While there are over a dozen candidates in the race, others rounding out the top are Zury Ríos, daughter of the former dictator and candidate for the Vision with Values (Viva) party, and Roberto González, a former energy minister representing the Unionist Party (PU) who faces charges for influence peddling. Mario David García, a lawyer and the candidate for the governing Patriotic Party (PP), polls well behind. He replaced the PP’s original candidate, Alejandro Sinibaldi, who left the party after the La Línea scandal emerged.

What do the polls say?

Even with the validity of polls in this election round called into question, signs point to no candidate garnering the necessary “50 percent plus one” of the votes to avoid a second round. A survey published August 10 and carried out by Predatos for Guatemala’s Prensa Libre puts Baldizón in the lead, followed by Morales and Torres in a technical tie.