changed loss calc for labeled arcs