The Great Wall of China is a series of short walls made of predominantly rammed earth, stone, and wood, which stretch over 21,196 km from Dandong in the east to Lop Lake in the west. It was built thousands of years ago and has undergone many renovations since the 5th century. The Great Wall's initial purpose was to protect the Chinese states and empires from invasions and raids. Later, the wall was used as border control, and for the encouragement of trade.