functions to generate timeline