bs location algo