Implementing another solution for text processing