Made the functionality between buttons and other elements