Created counter with better refactoring for slides