integrated and almost works.
moved buttons out of panel
moved button check out of interrupt context