updates to quantization code