By the beginning of August, the Polish retreat had become more organized, as their supply lines were steadily shortened. At first, Józef Piłsudski wanted to stop the Soviets at the Bug River and the city of Brest-Litovsk, but the Soviet advance resulted in their forces breaching that line, making that plan obsolete. On the night of August 5–6, Piłsudski, staying at the Belweder Palace in Warsaw, conceived a revised plan. In the first phase, it called for Polish forces to withdraw across the Vistula River and defend the bridgeheads at Warsaw and at the Wieprz River, a tributary of the Vistula southeast of Warsaw. A quarter of the available divisions would be concentrated to the south for a strategic counteroffensive. Next, Piłsudski's plan called for the 1st and 2nd Armies of General Józef Haller's Central Front (10½ divisions) to take a passive role, facing the Soviet main westward thrust and holding their entrenched positions, Warsaw's last line of defence, at all costs. At the same time, the 5th Army (5½ divisions) under General Władysław Sikorski, subordinate to Haller, would defend the northern area near the Modlin Fortress; when it became feasible they were to strike from behind Warsaw, thus cutting off Soviet forces attempting to envelop Warsaw from that direction, and break through the enemy front and fall upon the rear of the Soviet Northwestern Front. Additionally, five divisions of the 5th Army were to protect Warsaw from the north. General Franciszek Latinik's 1st Army would defend Warsaw itself, while General Bolesław Roja's 2nd Army was to hold the Vistula River line from Góra Kalwaria to Dęblin.