This commit: re-added emd code