Added button functionality and local Shared Preferences