script to trim links between areas and elections