The Berlin wall was built in order to

Astop the flow supplies from West Germany to West Berlin
Bprevent food from entering Poland
Cprevent the smuggling of arms to anti-Soviet-forces
Dprevent East Germans from defecting the West Germany