changed to log likelihood based functions