Then the priests and Levites were divided into groups that would take turns to serve at the temple. They did this according to what Moses had written many years previously in the laws that he wrote.