simplify compression function to compress per block, add to main, cleanup file_io