added slideshow code refactored with this setup 2