re-wrote code in a more structured way, added brightness setting
through msg.topic