Buddhist texts generally credit the establishment of the monastic rules to Śāriputra, with Śāriputra being the one to ask the Buddha to create the rules. When Śāriputra asked the Buddha, he said he would lay them down at the right time. Śāriputra was known for his conscientiousness and meticulous adherence to monastic rules. In one story, Śāriputra became ill with an ailment that could be treated with garlic, but refused it because the Buddha had previously laid down a rule forbidding monks to eat garlic, with Śāriputra only taking it after the Buddha rescinded the rule. In another story, Śāriputra found that meal cakes tended to make him greedy and then made a vow to abstain from them. A Buddhist commentary describes that one time when the other monks had left to collect alms, Śāriputra meticulously cleaned and organized the monastery to keep heretics from criticizing the disciples. Several Buddhist texts relate that Śāriputra was reborn as a snake in a previous life and that this was the reason for some of his stubbornness. In a Mahāsāṃghika text the Buddha punished Śāriputra by making him stand in the sun for failing to prevent some monks from making incorrect remarks. When the other monks later asked the Buddha to stop the punishment, the Buddha said that Śāriputra's decision to receive the punishment could not be changed, just as he was unwilling to change his mind when he was a snake. In a Mahīśāsaka text, Śāriputra refused to take a type of fruit, even when prescribed as medicine, after another monk suspected him of sneaking delicious food, the Buddha likewise references Śāriputra's life as a snake to explain his stubbornness.