removed test code
Optimized compress key code