Further work, button handling much improved here