here is the function saving JSON in the correct format for the timeline #7