Shouldn't this be \sum_i \sum_j ?