Illinois students don’t have to play hooky or worry about rushing to the polls after school anymore thanks to a new law that allows students to be excused from class to cast their ballots.

Gov. J.B. Pritzker signed legislation this past week giving Illinois students two hours away from school to vote in a primary, general, special or any other public election.

“With this new law, our voting-eligible young people will have the freedom to fit voting into their school day without fear of repercussion for engaging in the very civic education we should all be proud to encourage,” Pritzker said in a statement. “The young people who advocated for this legislation recognized how important it is not only to vote but to make the act of voting as accessible for all who can vote.”

The law came to pass after students from Thornton Fractional North High School and Thornton Fractional South High School in the south suburbs took the idea to state Sen. Elgie Sims, who co-sponsored the bill with state Rep. Nick Smith.

“The advocacy of the students in my district convinced me I had to sponsor this legislation, and their passion helped get it over the finish line,” Sims said in a news release. “Hopefully, this new law will excite Illinois students and encourage them to take their civic duty as voters seriously.”

The new law won’t take effect until June 1, meaning students hoping to vote in the March 17 Illinois primary will still have to go on their own time.

But for the November general election, students will be able to vote on an early voting day or the day of the election. Schools will decide which two hours students can be excused from class.