use @kcwu's idea for better compression ratio