nmd: int-array for feature space savings
more nmd refactoring for speed and memory