working on a slide iterator function