in preparation for their mission against the railroad, they received a surprise visitor, President Abraham Lincoln, who had traveled by water and landed at City Point, Grant's newly established headquarters. He told Grant, "I just thought I would jump aboard a boat and come down and see you. I don't expect I can do any good, and in fact I'm afraid I may do some harm, but I'll just put myself under your orders and if you find me doing anything wrong just send me right away." After discussing strategy with Grant, Lincoln visited some of the VI Corps troops who would participate in the upcoming battle. Battle On June 21, elements of the II Corps probed toward the railroad and skirmished with Confederate cavalry. The plan of attack was that both the II and VI Corps would cross the Jerusalem Plank Road and then pivot northwest about to reach the railroad. Difficult terrain—swamps and thickets—slowed their advance and by the morning of June 22, a gap opened up between the two corps. While the II Corps began pivoting as planned, the VI Corps encountered Confederate troops from Maj. Gen. Cadmus Wilcox's division of Lt. Gen. A. P. Hill's corps and they began to entrench rather than advance. Brig. Gen. William Mahone, another division commander in Hill's corps, observed that the gap between the two Union corps was widening, creating a prime target. Mahone had been a railroad engineer before the war and had personally surveyed this area south of Petersburg, so he was familiar with a ravine that could be used to hide the approach of a Confederate attack column. Robert E. Lee approved Mahone's plan and at 3 p.m. on June 22, Mahone's men emerged in the rear of the II Corps division of Brig. Gen. Francis C. Barlow, catching them by surprise. A soldier wrote, "The attack was to the Union troops more than a surprise. It was an astonishment." Barlow's division quickly collapsed under the surprise assault. The division of Brig. Gen. John Gibbon, which had erected earthworks, was also surprised by an attack from the rear and many of the regiments ran for safety. Mahone sent an urgent message to Wilcox, asking him to join in the attack; but Wilcox was concerned about the VI Corps men to his front and the two regiments he sent in support arrived too late to make a difference.