Set up table and button logic