Thousands of immigrants denied a shot at American residency are holding their breaths Friday as the U.S. State Department announces the green card lottery to replace an initial, flawed attempt.

The annual green card lottery draws millions of international applicants hoping to be randomly selected for a permanent resident visa, or green card. This year elation turned to despair for 22,000 people who were told they had been granted visas, only to see those results rescinded because of an error in the computer program that makes the picks.

The people denied visas filed a class action lawsuit to avoid being returned to the pool of some 15 million applicants, but a judge dismissed the case. Because the computer program mistakenly favored people who had applied earlier, the judge reasoned, the selection process was not random and had to be voided.

It is a big blow for my plans, a Togolese technology worker named Sedem Kokou Agbobli who quit his job when he first thought he had won a visa told the Washington Post. I don't know how I will survive.

The U.S. immigration system is an alphabet soup of visa categories -- from F-1's to H1-B's -- that correspondent to different skill sets, family ties or reasons for being in the country. But the visa lottery is open to practically everyone who passes background checks, has a high school education and does not come from a country like Mexico or India that contributes large numbers of immigrants to the U.S.