smoothing seems to be working, but something could be wrong with my perplexity calculation