Though Muhammad Ali's chief aim was to establish a European-style military, and carve out a personal empire, he waged war initially on behalf of the Ottoman Sultan, Mahmud II, in Arabia and Greece, although he later came into open conflict with the Ottoman Empire. He used several new strategies to ensure the success of his new military. First new recruits were isolated from the environment they were used to. They began housing soldiers in barracks, leadership enforced a strict regime of surveillance, roll call was done several times a day, and corporal punishment used to ensure the new fighting force grew to become a strong disciplined military. The army often used the bastinado and the whip to control and punish the soldiers. Muhammad not only wanted his soldiers to be disciplined, but he also created many military codes to regulate the definitions of crime and punishment, this helped to create blind obedience to the laws. A large part of Ali's goal of a European-style military was through the creation of new labelling and organizational systems to identify soldiers, distinguish officers from enlisted men, structure units, and properly distribute salaries. Soldiers were given a unique number that identified their unit and their role within it, and officers were expected to use lists with these numbers to keep a close watch on the men and ensure every man performed his clearly assigned duty. This was particularly useful in identifying deserters who often fled in the chaos of massed movement, such as during forced marches or relocation to a new encampment.