nit: do a `_.map(_.range(N), ...)` so as to not duplicate these three lines