The Black Codes of 1865 . As newly freed slaves would soon learn, freedom was not as they had anticipated. White southerners were anxious to regain power over them, and used the law in order to achieve that objective. In 1865, southerners created Black Codes, which served as a way to control and inhibit the freedom of ex-slaves. Codes controlled almost all aspects of life, and prohibited African Americans from the freedoms that had been won. Not only did whites want to control ex-slaves, but also they needed laborers. While things could no longer be exactly the same as in slavery, they found a way to guarantee that blacks would serve as their laborers. To do this, they created Black Codes. While Codes were unique to the post-Civil War south, they encompassed some of the antebellum restrictions on free blacks, northern apprenticeship laws, and the Freedmen's Bureau and the War Department regulations. Codes regulated civil and legal rights, from marriage to the right to hold and sell property to the predestined definition of African Americans as agricultural laborers. Laws were different in each state, but most embodied the same kinds of restrictions. Commonly, codes compelled freedmen to work. In many states, if unemployed, blacks faced the potential of being arrested and charged with vagrancy. Many of those that did work had their day regulated. Codes dictated their hours of labor, duties, and the behavior assigned to them as agricultural workers. Black Codes left African Americans with little freedom. Even the freedom to chose a type of work was often regulated. Many white southerners believed blacks were predestined to work as agricultural laborers. In addition, the advantage of regulating occupations provided them with laborers. In South Carolina, for example, a special license and certificate from a local judge attesting to a freedman's skill had to be obtained in order to pursue work in any occupation other than in agriculture or domestic work. Self-sufficiency was also discouraged. Codes prevented African Americans from raising their own crops. In Mississippi, for instance, they were restricted from renting or leasing any land outside of cities or towns and black ownership was left up to local authorities. Almost every aspect of life was regulated, including the freedom to roam. Often blacks were prohibited from entering towns without permission. In Opelousas, Louisiana, blacks needed permission from their employer to enter the town. A note was required, and it had to state the nature and length of the visit. Any black found without a note after ten o'clock at night was subject to imprisonment. Residency within towns and cities was also discouraged. Local ordinances in Louisiana made it almost impossible for blacks to live within the towns or cities. Residency was only possible if a white employer agreed to take responsibility for his employee's conduct.