first implementation of loglikelihoods, needs to be tested