Verses 16 through 23 are concerned with the temporary forgiveness of Shimei.
First, we have Shimei's repentance and welcome of David (vv. 16-20). Shimei said to the king, "Let not my lord consider me guilty; and do not remember how your servant did wrong on the day my lord the king went forth from Jerusalem, that the king should take it to heart. For your servant knows that I have sinned; and I have come today, the first of all the house of Joseph to come down, to meet my lord the king" (vv. 19-20).
Abishai the captain of David declared that Shimei should be put to death for cursing Jehovah's anointed (v. 21). But David said to Abishai, "Should any man in Israel be put to death today? For do I not know that today I am king over Israel?" (v. 22). Then the king swore to Shimei that he would not die (v. 23).
In verses 24 through 30 we see David's kind and fair arrangement for Mephibosheth. After Mephibosheth's vindication, David said that Mephibosheth and Ziba, his servant, would share the land.
In verses 31 through 39 there is an account of David's reward to Barzillai.
Barzillai, a very great man, had provided food to David and escorted him in crossing over the Jordan on the way back to his palace (vv. 31-32).
David invited Barzillai to go with him and promised to take care of him in his old age in Jerusalem, but Barzillai turned David's reward from himself to his son Chimham (vv. 33-39). In reply to Barzillai's request, David said, "Chimham shall cross over with me, and I will do with him what seems good in your sight; and whatever you wish for me to do, I will do for you" (v. 38).