Each group, no matter how large or small, was assigned a gate to guard, and they let the LORD show them what he wanted done.
Each one was assigned his duties in the same way that their relatives the priests had been assigned their duties. David, Zadok, Ahimelech, and the family leaders of the priests and Levites were the witnesses.
However, both families included temple officials and priests, and so to make sure the work was divided fairly, David asked God what to do.
David assigned them their duties by asking the LORD what he wanted. Everyone was responsible for something, whether young or old, teacher or student.
The guards were divided into groups, according to their family leaders, and they were assigned duties at the temple, just like the other Levites.
Shelemiah was chosen to guard the East Gate. Zechariah his son was a wise man and was chosen to guard the North Gate.