how a coil works