army landed at Veracruz and advanced toward Mexico City. The army met the Mexican forces at the battles of Molino del Rey and Chapultepec outside Mexico City. For his bravery at Molino del Rey, Grant was brevetted first lieutenant on September 30. At San Cosmé, Grant directed his men to drag a disassembled howitzer into a church steeple, then reassembled it and bombarded nearby Mexican troops. His bravery and initiative earned him his brevet promotion to captain. On September 14, 1847, Scott's army marched into the city; Mexico ceded the vast territory, including California, to the U.S. on February 2, 1848. During the war, Grant established a commendable record, studied the tactics and strategies of Scott and Taylor, and emerged as a seasoned officer, writing in his memoirs that this is how he learned much about military leadership. In retrospect, although he respected Scott, he identified his leadership style with Taylor's. However, Grant also wrote that the Mexican war was morally unjust and that the territorial gains were designed to expand slavery, stating, "I was bitterly opposed to the measure ... and to this day, regard the war which resulted as one of the most unjust ever waged by a stronger against a weaker nation." He opined that the Civil War was divine punishment on the U.S. for its aggression against Mexico. During the war, Grant discovered his "moral courage" and began to consider a career in the army. Historians increasingly have pointed to the importance of Grant's experience as an assistant quartermaster during the war. Although he was initially averse to the position, it prepared Grant in understanding military supply routes, transportation systems, and logistics, particularly with regard to "provisioning a large, mobile army operating in hostile territory," according to biographer Ronald White. Grant came to recognize how wars could be won or lost by crucial factors that lay beyond the tactical battlefield. Serving as assistant quartermaster made Grant a complete soldier, and learning how to supply an entire army gave Grant the training to sustain large armies. Post-war assignments and resignation Grant's first post-war assignments took him and Julia to Detroit on November 17, 1848, but he was soon transferred to Madison Barracks, a desolate outpost in upstate New York, in bad need of supplies and repair. After four months, Grant was sent back to his quartermaster job in Detroit. When the discovery of gold in California brought