To illustrate the planning and tenacity required for “aliens” to be able to live and work in the U.S., I’m going to tell my personal story of how I transitioned from alien to American. But before doing so, I must remind you that because each alien’s options are dependent on her or his own circumstances, and because immigration laws are complex and ever changing, any alien contemplating their future in the U.S. should be speaking with an immigration attorney.

My story starts with me finishing up my studies in Toronto, Canada, where I grew up, and starting my career. Recognizing that I needed a change of scenery, I decided to apply to jobs in the U.S. and see where that decision took me. After visiting the city for the first time during a job interview, that decision brought me to Boston.

Like many aliens, I was a bit unsure of what I would think about living in the United States. I knew one person in the entire city, I didn’t have much money, and no one would give me a credit card. So, I told myself to give it at least a year, and if I didn’t like it, I could always go home. But first I had to figure out a way to get in.

Step 1: My TN Visa. Luckily, I had proximity on my side. Under the North American Free Trade Agreement (NAFTA), Canadians and Mexicans in certain professions can obtain a TN visa to temporarily work in the U.S. Those professions include engineers, graphic designers, lawyers (like me), computer systems analysts and scientists. You also need a job lined up where you are employed by someone other than yourself. A TN visa doesn’t work if you want to be self-employed or employed by an entity of which you are the controlling shareholder or owner. Pulling up to the border, I got out the key documents needed to get my TN visa—my job offer letter and my original diploma—and was allowed in to work. Prior to 2008, the TN visa was only valid for a year, so once a year I made an annual pilgrimage back to Canada to get it renewed. Today the TN visa lasts three years and can be renewed indefinitely (although I’d get nervous that the more times I renewed it, an immigration officer having a bad day would question whether I really intended to stay in America “temporarily”).

Step 2: My H1-B Visa. A couple of years into my stint as an alien, I was enjoying my work, Boston, and my new social circle. However, living through the dot-com boom and bust, and the layoffs that followed, made me realize, that my ability to work in the U.S. would end suddenly if the job to which my TN visa was tied ended. I started to ask how I could change my “temporary” status into something more permanent. I couldn’t apply for a Green Card while still on a TN visa because the Green Card application proves I no longer meet the “I only intend to stay temporarily” requirement of the TN. I couldn’t marry an American because I had already fallen in love with a fellow alien. Here is where I needed the help of an expert—an immigration attorney—and for my circumstances, we went the H1-B visa route.

The H1-B visa is used by employers to hire foreigners to fill specialty occupations like scientists, engineers, lawyers, or software developers. It has a number of requirements including payment of the “prevailing wage” for your occupation, to ensure you are not deflating wages for workers in the U.S. But the biggest hurdle today is that there is an annual cap on how many are awarded. H1-B visas are so oversubscribed that the annual window for applying is less than a week and a lottery is run to see which of those applicants actually get an H1-B visa. In April 2015, there was a record filing of 233,000 H1-B petitions for just 85,000 H1-Bs. When I went through the H1-B visa process, the cap was almost double what it is today and there was no lottery. Relying on my expert, I was able to move to an H1-B visa pretty seamlessly.

While I was happy to have my H1-B visa, I was already thinking ahead. An H1-B has an end date of six years; it is a three-year visa that can be renewed once. There are ways to get it extended beyond six years, but only if you’ve started the Green Card filing process well in advance of the six-year deadline. So, after getting my employer on board, I put my expert to work and we went after the Green Card.

Step 3: My Green Card. The first step in the process of getting a Green Card based on employment was to complete the labor certification (now also known as PERM). This involved drafting a job description reflecting the specific tasks that my employer wanted me to perform, getting a prevailing wage determination from the U.S. Department of Labor that corresponded to this description, and advertising for the job that I was to fill. Essentially, my employer had to run a recruitment process to demonstrate that there was no American with the requisite skills available to fill this job.

Having successfully demonstrated that I wasn’t taking a job away from an American (whew!), my labor certification was filed with the Department of Labor about a year after I moved to an H1-B visa. Then I waited. About a year later, my labor certification was approved and I got to move on to the step of filing the I-140 petition, which essentially asks U.S. Citizenship and Immigration Services to determine that I’m eligible for an immigrant visa based on my employment. Then I waited. I checked the status of the petition pretty religiously. Earlier in the year, when we expected the approval to come through, my alien partner and I got married in the Boston public garden so that he’d get to piggy back on my Green Card and get one too. Once the I-140 approval came through, I applied on a Form I-485 to register as a permanent resident (aka Green Card holder). Somewhere along the way my now husband and I had to have a medical exam and travel to Rhode Island to have our fingerprints and photos taken.

A little over three years after we had started the Green Card process, I had one in my hands and to me it was gold. I could quit my job without fear of having to leave the country (and I promptly did so). Grateful to finally feel like the United States was our home, we followed the traditional American dream of buying a house in the suburbs and having kids who, unlike us, were actually American.

Step 4: U.S. Citizenship. Getting the Green Card started another clock for us. We could become U.S. citizens five years after being on a Green Card. Becoming a U.S. citizen was a no-brainer for my husband and I. We could keep our original citizenships and we could finally vote (not being able to vote for the construction of sports fields in my town, yet alone the President, was pretty frustrating). We could bring elderly parents to the U.S. if we needed to take care of them, and we wouldn’t have to face the higher estate taxes that are imposed on non-citizens when they die. Another reason struck me when we switched rental cars in London and left our passports in the car we left behind—the pain of having to get paperwork from multiple countries if we ever lost our passports was not something I ever wanted to face.

Nearly seven years after getting our Green Card, we filled a Form N-400 on our own, no expert needed, and applied to become U.S. citizens. To get this final prize, we had to go through an interview and take a test on U.S. history and government. My husband studied and answered every question correctly. I didn’t and consequently will never forget that there are 27 amendments to the U.S. Constitution.

The last stop on the journey was my citizenship ceremony. I went into it counting the minutes until I could get back to work but, once there, I found it very moving and I was reminded me of how lucky I truly am. My immigration journey from TN visa to H1-B visa to Green Card to U.S. Citizen took me 12 years. But with a lot of patience, planning, and expert help I made it, and now Uncle Sam can’t kick me out.