code for learning node