On the night of June 18-19, Gen. Joseph E. Johnston, fearing envelopment, moved his army to a new, previously selected position astride Kennesaw Mountain, an entrenched arc-shaped line to the west of Marietta, to protect his supply line, the Western & Atlantic Railroad. Having encountered entrenched Rebels astride Kennesaw Mountain stretching southward, Sherman fixed them in front and extended his right wing to envelop their flank and menace the railroad. Joe Johnston countered by moving John B. Hood's corps from the left flank to the right on June 22. Arriving in his new position at Mt. Zion Church, Hood decided, on his own, to attack. Warned of Hood's intentions, Union generals John Schofield and Joseph Hooker entrenched. Union artillery and swampy terrain thwarted Hood's attack and forced him to withdraw with costly casualties. Although the victor, Sherman's attempts at envelopment had momentarily failed.