Adding in multithreading and sqlite3 storage