trying to reduce memory in stratify