add date generation function and tweak comment