more update on threads.  should run if you uncomment lines 408-411. will delete entries before inserting new ones