Hinge Algorithm