Debug: prints i and fixed a typo