allow a greater number of samples when use_samples_val is set

also, add some data compression
clean up comment