verified the correctness of EM implementation