worked on the suboptimal compression, still needs some debug