refactored compressor function, refactored index