Taliban forces meanwhile began regrouping inside Pakistan, while more coalition troops entered Afghanistan to help the rebuilding process. The Taliban began an insurgency to regain control of Afghanistan. Over the next decade, ISAF and Afghan troops led many offensives against the Taliban, but failed to fully defeat them. Afghanistan remains one of the poorest countries in the world because of a lack of foreign investment, government corruption, and the Taliban insurgency. Meanwhile, Karzai attempted to unite the peoples of the country, and the Afghan government was able to build some democratic structures, adopting a constitution in 2004 with the name Islamic Republic of Afghanistan. Attempts were made, often with the support of foreign donor countries, to improve the country's economy, healthcare, education, transport, and agriculture in Reconstruction in Afghanistan. ISAF forces also began to train the Afghan National Security Forces. Following 2002, nearly five million Afghans were repatriated. The number of NATO troops present in Afghanistan peaked at 140,000 in 2011, dropping to about 16,000 in 2018.