Add 3d EMF calculation, but not tested yet