added button code from previous branch