added likelihood function