updated stratify: much less time consuming