Passage: Gun, the father of Yu the Great, is the earliest recorded member of the Xia clan. When the Yellow River flooded, many tribes united together to control and stop the flooding. Gun was appointed by Emperor Yao to stop the flooding. He ordered the construction of large blockades (levees) to block the path of the water. The attempt of Gun to stop the flooding lasted for nine years, but it was a failure because the floods became stronger. After nine years, Yao had already given his throne to Shun. Gun was ordered to be imprisoned for life to reform the Eastern Barbarians by Shun at Yushan (Chinese: 羽山), a mountain located between modern Donghai County in Jiangsu Province and Linshu County in Shandong Province.

Question: Why was Gun appointed?
stop the flooding