Complex sentence: There is a legend that it was a tradition for the spikes on top of the railings to curve outwards to keep the devil out, but on Arthur McNamara's grave, the spikes were turned in--to prevent him from escaping.
Split into simpler sentences: There is a legend that it was a tradition for the spikes on top of the railings to curve outwards to keep the devil out. But on Arthur McNamara's grave, the spikes were turned in--to prevent him from escaping.