Got thread to work. Need to clean up reading files