Added Relay Stress Algorithm

Revise some code