Added button functionality and made code more efficient