change from 1..N to 0..N-1