Bunch of code to make the Charger GUI work