Finished commenting and optimizing log-likelihood code.