correct calculation of LOG cost