Washington (CNN) The NSA is gearing up to collect millions of Americans telephone metadata -- again.

Just two days after the agency shut down that program when the Patriot Act provision that authorized it expired Sunday at midnight, the Senate restored those authorities, allowing the government to reinstate bulk data collection -- for the next six months.

How?

By passing the USA Freedom Act, the bill intended to end that very program, which is being lauded by most reform advocates as the right balance to rein in the NSA's domestic surveillance powers.

That's because the bill gives the government a six-month period to transition to the new system, under which telecommunications companies would hold onto the data, only handing information over if the government has a targeted warrant.

Read More