Added: function Tonelli-Shanks