Changed a bit the way the engine works (added work with thread pool)