add analysis logic