completed function for real labels + test set