add macro for perplexity