During 1865 and 1866, all Southern states except North Carolina sought substitutes for old codes aimed at controlling slaves and passed a number of new codes. The purpose of these Black Codes was to protect the states’ agricultural interests by rendering immobile the dependent black labor force. The codes aimed to immobilize the penniless, unemployed, and powerless laborers, but were worded so that whites were exempt and only blacks were restricted by the new laws. Those in violation were arrested and hired out for one year. The Black Codes were made illegal when Reconstruction ended; however, many Southern practices ensuring some form of forced labor continued well into the twentieth century.