brought generate into the iterate function, update of voxel