Good catch! "j" should be used in the next line, but the logic here is correct.