Verses 1-4 - David and Ziba
Verses 5-14 - Shimei curses David
Verses 15-23 - the advice of Hushai and Ahithopel