What logistical challenges did both armies face at Gettysburg?