Gamma ray bursts as electromagnetic outflows