A bunch of text processing code