major revision of currentSlide logic which intern simplified the code