added stream compaction