An algorithm for regression quantiles