Deuteronomy 17's very exciting - God tells Israel that He'll appoint a king for them, and the king has to get himself a notebook and write out the WHOLE levitical law, and read it all the days of his reign, so that he'll fear the LORD and lead the Israelites in the right way.
When God appoints a man to lead His people, that man is to soak himself in the Law, so that he fears the Lord and leads His people in ways of righteousness.
And God sent the promised King who fulfilled the Law, coming to be our righteousness, so we could be God's children, and follow our King :)