The army of Chanadragupta and Chanakya invaded Dhana Nanda's kingdom, but disbanded after facing a severe defeat. While wandering in disguise, the two men once listened to the conversation between a woman and her son. The child had eaten the middle of a cake, and thrown away the edges. The woman scolded him, saying that he was eating food like Chandragupta, who attacked the central part of the kingdom instead of conquering the border villages first. Chanakya and Chandragupta realized their mistake. They assembled a new army, and started conquering the border villages. Gradually, they advanced to the kingdom's capital Pataliputra (Pāṭaliputta in "Mahavamsa"), where they killed the king Dhana Nanda. Chanakya ordered a fisherman to find the place where Dhana Nanda had hidden his treasure. As soon as the fishermen informed Chanakya about its location, Chanakya had him killed. Chanakya anointed Chandragupta as the new king, and tasked a man named Paṇiyatappa with eliminating rebels and robbers from the kingdom.