working with files and a thread works. this is an eyesore