How to avoid wandering off while learning