add thread for reading from file, minor name fixes