Added some text processing code