Made the changes proposed by Stephen
transformation to normal ternary quadratic method implemented
Minor changes