actually produces n values instead of n+1