removed bogus line $j = $i;