created likelihood function