added EM derivation - not finished