added new method sortText() in TextBuddy.java