Why ‘bad’ ads appear on ‘good’ websites – a computer scientist explains