One disadvantage of the phalanx was that it was only effective when fighting in large, open spaces, which left the Romans at a disadvantage when fighting in the hilly terrain of central Italian peninsula. In the 4th century BC, the Romans abandoned the phalanx in favour of the more flexible manipular formation. This change is sometimes attributed to Marcus Furius Camillus and placed shortly after the Gallic invasion of 390 BC; it is more likely, however, that they were copied from Rome's Samnite enemies to the south, possibly as a result of Samnite victories during the Second Samnite War (326 to 304 BC).