Dynamic functionality for buttons

*