switchanged bonline-offline switch code to something less naive, actually debounces/checks the switch now