Working functions

Functions with buttons are now working properly.