Adding learning mode