As for those of your women who are guilty of immoral conduct, call upon four from amongst you to bear witness against them. And if four men do bear witness, confine those women to their houses until either death takes them away or Allah opens some way for them. 15 And as for the two who are guilty of indecency from among you, give them both a punishment; then if they repent and amend, turn aside from them; surely Allah is Oft-returning (to mercy), the Merciful. 16 (And remember that) Allah's acceptance of repentance is only for those who commit evil out of ignorance and then soon repent. It is towards such persons that Allah turns graciously. Allah is All-Knowing, All-Wise. 17 Forgiveness is not for those who continue to do evil deeds until, when death comes upon one of them, he says: "Now I repent!" nor from those who die as deniers of the truth. We have prepared a painful punishment for them. 18 O People who Believe! It is not lawful for you to forcibly become the women’s heirs; and do not restrain women with the intention of taking away a part of bridal money you gave them, unless they openly commit the shameful; and deal kindly with them; and if you do not like them, so it is possible that you dislike a thing in which Allah has placed abundant good. 19 And if you wish to change one wife for another and you have given her heaps of treasure, do not take back anything from it; will you take it back by slander and open sin? 20 And how can you take it when one of you has already gone in to the other and they have made with you a firm covenant? 21 AND DO NOT marry women whom your fathers have previously married - although what is past is past: this, verily, is a shameful deed, and a hateful thing, and an evil way. 22