In recent months, few things captivated the Boston public more than the mayoral election to succeed ever-endeared Mayor Tom Menino. For some millennials, it was the only election of its kind they’ve ever witnessed. And while habitants of The Hub watched the election results roll in sporadically, gazes glued to TVs and real-time mobile devices, the Election Department of Boston scrambled to make sure all ballots were properly marked and all numbers were accurately counted.

Kidding.

BostInno spoke with Sabino Piemonte of the department to find out what happens behind the scenes on election night, and as it turns out, the process is as underwhelming as the final results were for John Connolly supporters.

“Votes are tabulated at the polls,” Sabino began. “Each poll has its own machine. The machine prints out a report. The report is then uploaded to servers. There’s no manual input of the data.”

Done and done. When asked why votes can’t be tallied on the fly, Sabino told us bluntly “It’s against federal law.” Not a single vote in any election nationwide can be counted until polling stations officially close.

But counting votes is far from an exact science as evidenced by the innumerable recounts and fraudulent ballots seen over the years in elections of all sizes and scope. For Boston’s municipal elections, the likelihood of error is as slim Marty Walsh’s 3-point margin of victory.

Is the system flawless? “Pretty close,” notes Sabino. The only real issue to jeopardize the entire system is that of the technical variety. If something compromises the servers, it compromises the integrity of the election.

To put it in perspective, consider it like if “a computer crashes and erases the data. Clears all of the information out. We have to re-burn the card,” Sabino said.

But an occurrence like this has only happened a handful of times over the past decade and Sabino sounded assured of its robustness.

Days after the election, though, is when things get a bit murkier. “We can get between zero and 2,000 provisional voters,” Sabino says of those who cast a ballot when there are questions about any one voter’s eligibility. Once those are compiled, the unofficial results are updated and rendered valid.

And when it comes to write-in candidates, who rarely win though it has happened on occasion, sometimes a positive show is just as meaningful as an all-out win.