implemented new computeSample2AvgLabel