You should be able to use `currentSlide` to find the present slide, which would cut back on the condition here.