You can just use `contentItems.length` to keep track of where you are, no need for the extra variable