implemented log-score