codes for the learning curve