quantiles now working but needs cleanup