added a more modern way to implement sliding butto