The Buddha initially insisted that she give the robe to the community as a whole rather than to be attached to his person. However, Ānanda interceded and mediated, suggesting that the Buddha had better accept the robe. Eventually the Buddha did, but not without pointing out to Ānanda that good deeds like giving should always be done for the sake of the action itself, not for the sake of the person. The texts say that the Buddha sometimes asked Ānanda to substitute for him as teacher, and was often praised by the Buddha for his teachings. Ānanda was often given important teaching roles, such as regularly teaching Queen Mallikā, Queen Sāmāvatī, () and other people from the ruling class. Once Ānanda taught a number of King Udena ()'s concubines. They were so impressed by Ānanda's teaching, that they gave him five hundred robes, which Ānanda accepted. Having heard about this, King Udena criticized Ānanda for being greedy; Ānanda responded by explaining how every single robe was carefully used, reused and recycled by the monastic community, prompting the king to offer another five hundred robes. Ānanda also had a role in the Buddha's visit to Vesālī. In this story, the Buddha taught the well-known text Ratana Sutta to Ānanda, which Ānanda then recited in Vesālī, ridding the city from illness, drought and evil spirits in the process. Another well-known passage in which the Buddha taught Ānanda is the passage about spiritual friendship (). In this passage, Ānanda stated that spiritual friendship is half of the holy life; the Buddha corrected Ānanda, stating that such friendship is the entire holy life. In summary, Ānanda worked as an assistant, intermediary and a mouthpiece, helping the Buddha in many ways, and learning his teachings in the process. Resisting temptations Ānanda was attractive in appearance. A Pāli account related that a bhikkhunī (nun) became enamored with Ānanda, and pretended to be ill to have Ānanda visit her. When she realized the error of her ways, she confessed her mistakes to Ānanda. Other accounts relate that a low-caste woman called Prakṛti (also known in China as ) fell in love with Ānanda, and persuaded her mother Mātaṅgī to use a black magic spell to enchant him. This succeeded, and Ānanda was lured into her house, but came to his senses and called upon the help of the Buddha. The Buddha then taught Prakṛti to reflect on