The o array needs to have up to N * 2 elements.