A basic version of learn() implemented.