A weighting scheme for least-squares structure refinement