Perplexity and complete language model

Handled bugs, calculated perplexity - working language model