learning and gathering codes