fix bug in date, add analysis in main