Adding functionality to create UI elements