Incorporated new torus function and removed the old one