Use `enumerate` instead of manually counting