Implemented a simple likelihood function