Changed active learning code