Added isFirstSlide and isLastSlide functions