Barbed wire entanglements were often 40 yards ( 36m ) from the front trench. Considering the types of weapons used on the western front what would be their main defensive function?