likelihood function edits