The growing accuracy and rate of fire of rifles, together with the invention of the Maxim machine gun in 1883, meant that close order line infantry would suffer huge losses before being able to close with their foe, while the defensive advantages given to line infantry against cavalry became irrelevant with the effective removal of offensive cavalry from the battlefield in the face of the improved weaponry. With the turn of the 20th Century, this slowly led to infantry increasingly adopting skirmish style light infantry tactics in battle, while retaining line infantry drill for training.