Did you fail to file or pay your taxes in time for Tuesday's deadline? If so, you get a second chance--the IRS just extended the deadline to Wednesday night at midnight.

What the heck is going on, and what should you do if you missed the original deadline? Here are some answers:

1. Why the extension?

Several of the systems that taxpayers use to file their tax returns began failing on Tuesday. So did the system that taxpayers can use to make direct payments from their bank accounts to the IRS. After struggling with the outages for much of the day, the IRS granted the extension to help out frustrated taxpayers who were unable to meed the deadline through no fault of their own.

2. What caused the outages?

The IRS has not yet provided details, but has indicated that the failure is "hardware-related" and that it had done a hard reboot. It seems to have worked--the agency says systems were back up and running late Tuesday. 

The fact that something broke down should surprise no one. The IRS--perhaps the least popular agency of the federal government--has been the target of budget cuts for years and staffing has dropped by about 18,000. That's one reason that 40 percent of taxpayers who call with questions are unable to get anyone on the line, according to a report in the Washington Post. Congress did just approve $320 million to help the agency cope with the sweeping tax law changes recently enacted, but critics say the agency will need more. Sounds likely: The IRS uses 60 different computer systems to handle taxes and two of those systems are reportedly 60 years old.

3. Why was the filing deadline so late to begin with?

Taxes are due on April 15, unless that day falls on a weekend or a holiday. This year, April 15 was a Sunday, so you might expect the deadline to have been Monday, April 16. However, in the District of Columbia, that day is Emancipation Day, which commemorates Abraham Lincoln signing the Emancipation Act. The Emancipation Act freed about 3,100 slaves in the District of Columbia. Eight months later, Lincoln signed the Emancipation Proclamation, freeing all the slaves in the South. 

4. What if I still can't get my taxes done in time?

Along with extended the deadline for filing and paying taxes by 24 hours, the extension also extends the deadline for filing for an automatic extension until midnight Wednesday night. If you're expecting a refund you don't need to do this--the IRS gives you three years to file your taxes if they owe you money--although of course you'll delay getting that money and they won't pay interest on it. 

On the other hand, if you owe them money, it's important to file for the automatic extension. You'll still owe your taxes and you'll still pay interest if you haven't paid them, but if you fail to file your return and fail to file the for for an extension, you'll pay an additional penalty of 5 percent of what you owe per month, up to a total of 25 percent. Ouch! The automatic extension form is easy to file and it's well worth taking a few minutes to do it if there's even a chance that you owe taxes this year.

5. Are states extending their deadlines too?

So far, there are no reports of states extending their deadlines to match the federal extension. On the other hand, some states actually have later deadlines than the federal deadline, and some grant automatic extensions as well. Check here to see what the rules are in your state.