Tonelli-Shanks working