Did you mean to use j here instead of i?