Added EM algorithm