corrected ngrams

either i was confused when i wrote this, or i am confused now, but my previous implementation of ngrams seems to make no sense at all... and, strangest, in addition to that it did give the correct answer for this projecteuler problem