added some learning code