working on button functionality