Changed multithreading for more linear approach to allow for better database update.