added compaction for script ranges