optimized quantize to use less memory