fixing bugs and refactoring class LearnLetter.java