Complex sentence: Great Falls remained the second largest city in Montana until 2000, when Missoula's incorporation of some surrounding neighborhoods resulted in its population surpassing that of Great Falls by a margin of 363 people.
Split into simpler sentences: Great Falls remained the second largest city in Montana until 2000. In 2000 with the zoning of some surrounding neighborhoods Missoula became the second largest city in Montana by a margin of 363 people.