God commands Moshe to count the nation, a command which interrupts the sequence between the Sin of Pe'or and the war of retribution against Midian. In addition to the military purpose of the census, and the need of a current count for settling the land, the census at the end of BeMidbar emphasises the family unit. Thousands were killed in the plague following the Sin of Pe'or, where illicit relations brought destruction upon the family unit. The census emphasizes the need to rehabilitate the nation by rebuilding and reinforcing the family unit.