add some EM-related code