restructured type system and added n-gram arrays