Second version of the chunkGenerator