added learn functionality