Added n-gram support