Added threading code for reading from text file.