More Generalized learning code