update torsion ang algorithm