Corrected Stepsize and perplexity calculations