linked the buttons and the vars