fixed error with tracking the current slide
fix looping issue
clean up. change var names