removed usused variables
removed config dumping, it's not needed
added a bit of a header, also better handling of 'off state'