Add working version of learningCurve