1. Instead of doing a while loop, then running the mainloop() function inside of it, you can now simply use the run() function without any other loop
2. To add logic or anything else you'd do in the while loop, simply make a function with the "event" decorator, it will be ran automatically when calling the run function at the bottom