Split out the UI and brute force solver