The war had been going on for three years when Ulysses S. Grant was given overall command of the Union Army. While a much smaller army, the Confederates had been moving their forces to battle whichever Union army was active at the time. By doing this, they had won most of the battles. Grant decided to coordinate his armies and defeat the confederates. His field armies would all engage the confederate field armies at the same time. This would pin down the smaller southern armies so the Union army could defeat them. Grant would personally lead the Army of the Potomac against Confederate general Robert E. Lee and his Army of Northern Virginia. He would try to capture the capital of the confederacy, Richmond. Sherman would move his combined armies against the Confederate Army of Tennessee led by General Joseph E. Johnston. One of Sherman's goals was to capture the South's second largest city, Atlanta. If successful, it would shorten the war.