adding detection likelihood function