Implement button logic