Created a background worker to execute the AI aritmethic usch that the UI does not block