Inside your click event listener for the previous arrow, you don't have the currentDot or nextDot variables created, so remove those two lines. Then, change nextSlide to prevSlide. And after that, change duration inside your next arrow click event listener to 600, and your code should work