Why does this use future values of `y`. Every reference I think this should be `y[i]` unless this is doing something I haven't seen.