added offset to position so that one can specify the center of the magnet coordinate system in z