added support for any size n-gram