add analysis function