Placed the renderSlideCount method at the top of the file so that it will be executed properly