One of the most obvious results of the reforms was the change in Qin's military. Previously, the army was under the control of Qin's nobles and comprised feudal levies. After Shang Yang's reforms, the aristocracy system was abolished and replaced by one based on meritocracy, in which ordinary citizens had equal opportunities as the nobles to be promoted to high ranks. In addition, military discipline was strongly enforced and the troops were trained to adapt better to different battle situations. Qin's military strength increased largely with the full support of the state. In 318 BC, the states of Wei, Zhao, Han, Yan and Chu formed an alliance and attacked Qin, but did not manage to advance beyond Hangu Pass, and were defeated by counter-attacking Qin forces. The alliance crumbled due to mistrust and suspicion and lack of coordination among the five states.