working stress algo