Added basic n-gram generalizing, fixed some n-gram definitions