fixing bugs and refactoring class LearnNumber.java