completing remaining button functionality and event handling