got bogged down and the Polish–Ukrainian War turned into trench warfare for the rest of the winter. In April 1919 Maczek was withdrawn from his unit and became the organizer and commander of the so-called 'flying' company () as part of Gen. Aleksandrowicz's 4th Infantry Division. This unit, created on Maczek's initiative, was modelled after the German Sturmbataillone of World War I and was highly mobile, with horse-drawn vehicles (in the singular, taczanka, podwoda) from Austrian Army depots, and well-equipped with heavy machine guns. The unit was formed mostly from battle-hardened troops of the Krosno battalion, and its combat value was well above the average of the Polish Army of the time. Hence it served in a "firefighter" capacity, plugging holes that appeared in defensive lines, but also fighting with distinction in the Polish spring offensive. It took part in some of the heaviest fighting of the war, including the battles for Drohobycz, Stanisławów, Buczacz, and finally the ZUNR capital, Stryj. After the end of the Polish–Ukrainian fighting, Maczek was confirmed in the rank of major with seniority from 1 June 1919. He was then attached to General 's Polish 2nd Army as a staff officer. Bored with staff duties, Maczek repeatedly asked his superiors to give him command over a front-line unit. His wish was fulfilled only after the start of the Polish–Bolshevik War, when the 2nd Army suffered a defeat in initial clashes with Semyon Budyonny's 1st Cavalry Army. In Jarosław, Maczek formed a new 'flying' rifle battalion, mostly composed of fresh recruits and horseless uhlans. Despite insufficient training, the unit was moved to the front and Maczek again acted as a "firefighter", moving his unit quickly to wherever it was needed. His unit covered the retreat of the Polish forces at Mosty Wielkie, after which it was attached to Gen. Juliusz Rómmel's 1st Cavalry Division. It took part in the Polish assault on Waręż near Zamość, a tactical counter-assault on the rear of Budyonny's advancing Cossacks directly preceding the victorious battle of Komarów. After the end of hostilities, Maczek's battalion was officially named after him, although it was disbanded shortly after the signing of the treaty of Riga. Interwar years Maczek decided not to resume his studies at Lwów University and remained in active service. Between 1921 and 1923 he commanded an infantry battalion within the Lwów-based 26th Infantry Regiment. On 1 August 1923 he was promoted