Changed index from i to j in spp update method.