code from learning session