Likelihood function working