Have a look here and search for the "LEARN" routine ;-)