Added code for text preprocessing