rough centering algorithm