Added likelihood calculations and outer run loop for EM.